"ELM327" is just a chip that understands OBDII protocol. One side is the car, the other side is software that reads the output of the ELM327. In 2019, that's usually a smartphone or a tablet with an ELM327-compatible app, like Torque. You can buy ELM327-based adapters that are wired, wireless, or use Bluetooth. Lots of options! Commonly people use Bluetooth based ones as they're convenient.
For my knowledge, is this "gateway" what it sounds like? A protocol gateway for various modules to pass messages back & forth? Like ECM -> TCM, or ABS -> ECM? Since it's a U-code, that's what it sounds like... that this device is a CAN gateway. If so, a CAN analyzer might be useful:
https://www.amazon.com/seeed-studio-See ... 199&sr=8-4CAN is pretty simple - you have signal Low and signal High, power and ground. Common failure scenarios with CAN is damage to the Low or High wires (they are low voltage, very sensitive), or a problem with the power or ground to one or more modules. A CAN analyzer can monitor messages on the bus and may give a clue about intermittent connectivity. OTOH, if it's a permanent condition you should be able to test for reliable power/ground at the gateway and integrity of the high/low wires (short to power or short to ground).
The nature of this error sounds like the ECM has lost communication with the CAN gateway, which suggests the error is between the two. I wouldn't think this is a problem at the TCM. I suspect the ECM cannot send/receive messages to the TCM because the Gateway is in the middle and it's broken. As a result, since it can't get things like throttle position and road speed, the TCM is defaulting to limp home. I would be doing integrity checks on the CAN low and CAN high wires between ECM and gateway first.
Edit: I would also echo what Mountainman said about relocating grounds. That's especially true when talking about low voltage signal wires. Often times shielding is configured in a very precise way, and moving a ground may have the unintended consequence of introducing noise that the shielding is designed to prevent. I haven't looked at wiring diagrams, I don't know what's grounded where, but on modern cars with sci-fi busses, it's wise to be sure about what's being moved.