Modbus TCP/IP Communication problem

Any ideas for the cause of the problem?

The library you're using faces the same problem as the String library delivered with the Arduino IDE: it make intensive use of dynamic memory management (allocation and deallocation of heap memory). This fragments the memory of AVR Arduinos quite fast and sooner or later you end in an out of memory situation because the request for a certain block sizes fails. As the library don't even check the value returned by malloc() it won't detect a memory problem.

Use another library or change to an ARM based Arduino (e.g. MKR series).