When using a Modbus TCP, you need to configure background polling for at least one datapoint in order to keep the TCP connection up and running. This is necessary even if you don't need the updates. If you don't configure background polling for at least one datapoint then writing to a datapoint on the Modbus device will most likely fail.
Workaround:
When using Modbus TCP devices, set the background polling (Datapoint Properties Widget) for 90 seconds for at least one datapoint.