If you like the sound of your G5n (many do), then it's still a very viable device, and it's an Audio Interface in it's own right.
IOW, you don't NEED the UX2.
Frankly, I doubt that GR5 sounds better. I've had GR5 for years, I never use it anymore.
The G5n lacks MIDI, but has the advantage over GR5 of being able to record with ZERO Latency, it being HARDWARE vs a PLUG-IN. Your UX2 (being pretty long in the tooth) probably has around 20ms latency. I don't know about the latency on the G5n, but I can tell you that the latency on my Helix (newer tech than either the G5n or the UX2) is around 20ms @ 128 samples. It's better at 64 samples (<>14ms), but my 7th gen i7 laptop can't handle 64 samples without noise.
Also keep in mind that in order control GR5 via MIDI you'll need a MIDI controller. You can still find the proprietary controller/interface that NI made on eBay, but that's VERY old and discontinued tech.
The FCB, while useful for controlling GR5, is better with the UNO chip. And one of the best added functions of the UNO chip, the ability to send Stompbox (CC) messages on preset load, doesn't work with GR5.
The FCB can, however be very useful for controlling the transport of your DAW. It's nice to be able to Start/Stop recording without taking your hands off your guitar!
Apart from controlling a plug-in or your DAW transport, the only use for MIDI is being able to control your audio hardware/plug-ins from recorded MIDI. IOW, with the G5n you won't be able to pre-record a performance and have the DAW playback do all of your preset changes on the G5n. Do you need that?
The best thing that you can do at this point is to make a list of your IMMEDIATE needs. Once you have that, I can give better advice.