TCP command frame from W5200 not recognized by 3G router

I have a monitoring system that automatically sends a SMS when an event occurs. I can also query the system remotely by sending a SMS with a keyword and the system sends a SMS containing a report.

The system is composed of a STM32 arduino-like board with a W5200 ethernet interface board, which is connected to a port of a Teltonika RUT500 3G router. My board sends TCP frames containing commands to manage the SMS traffic, and this works apparently well, though there are sometimes unexpected delays.
I then changed the router for the newer and more powerful model RUT900, that is claimed to have exactly the same command interface. But now no SMS are sent anymore.
If I analyze the ethernet traffic, I find the frames that contain the command that is perfectly correct; as a proof, if I copy the payload of the frame and I paste it to the data field of the windows tool Packet Sender, and I send the frame to the router, this time the router DOES send the SMS!
However if I look more closely, the next frames captured after the command are not the same according to the SMS is sent or not.
If the command works normally, the router responds with a frame containing “ok”, or some other information, according to the type of command. Otherwise, no frame is sent back.
Actually this occurs on any type of command to the router,with various effects.
Here is an example, with the command that queries the number of received SMS. I captured using Wireshark two occurrences of the command “sms_total”, the first time successfully and a response comes, the second time is a failure : (the identifiers have been changed to “xxxx” for privacy)

85 4.586611 HTTP 127 GET //cgi-bin/sms_total?username=yyyyyyy&password=xxxxxxxxxx HTTP/1.1
86 4.586611 TCP 60 80 → 1121 [ACK] Seq=1 Ack=74 Win=29200 Len=0
87 4.627634 TCP 123 80 → 1121 [PSH, ACK] Seq=1 Ack=74 Win=29200 Len=69 [TCP segment of a reassembled PDU]
88 4.829373 TCP 60 1121 → 80 [PSH, ACK] Seq=74 Ack=70 Win=1979 Len=0
89 4.829544 HTTP 165 HTTP/1.1 200 OK (text/plain)
90 5.031344 TCP 60 1121 → 80 [PSH, ACK] Seq=74 Ack=181 Win=1868 Len=0
93 5.186552 TCP 60 1121 → 80 [FIN, ACK] Seq=74 Ack=181 Win=2048 Len=0
94 5.186552 TCP 60 80 → 1121 [FIN, ACK] Seq=181 Ack=75 Win=29200 Len=0
95 5.186552 TCP 60 1121 → 80 [ACK] Seq=75 Ack=182 Win=2048 Len=0
100 5.694432 TCP 60 1122 → 80 [SYN] Seq=0 Win=2048 Len=0 MSS=1460
101 5.694432 TCP 60 80 → 1122 [SYN, ACK] Seq=0 Ack=1 Win=29200 Len=0 MSS=1460
102 5.694432 TCP 60 1122 → 80 [ACK] Seq=1 Ack=1 Win=2048 Len=0
103 5.697597 HTTP 127 GET //cgi-bin/sms_total?username=yyyyyyy&password=xxxxxxxxxx HTTP/1.1
104 5.697597 TCP 60 80 → 1122 [ACK] Seq=1 Ack=74 Win=29200 Len=0
105 6.021582 TCP 60 1122 → 80 [FIN, ACK] Seq=74 Ack=1 Win=2048 Len=0
106 6.022114 TCP 60 80 → 1122 [FIN, ACK] Seq=1 Ack=75 Win=29200 Len=0
107 6.022114 TCP 60 1122 → 80 [ACK] Seq=75 Ack=2 Win=2048 Len=0

Clearly there is something wrong in the ethernet communication. Wireshark does not say anything about it. What can it be? How can it affect the operation of the router? How can I fix it?
Thanks in advance.