I’m fairly sure that the behaviour in this case is a result of using a Serial to Ethernet gateway rather than a Modbus Serial to Modbus TCP gateway like this one from Phoenix Contact:
https://www.phoenixcontact.com/en-pc/products/interface-converters-gw-modbus-tcp-rtu-1e-1db9-2702764
I’m not aware of a PLCnext Engineer function block library that will help in this case. The simplest and most reliable solution is probably to use a device like the one above.