The problem is wrong router responses when the router query packet has a Transaction ID greater than 0x007F. In such cases, instead of including the same Transaction ID in the response, the router includes, for example:
router query: 0x0080
response from the router: 0xFF80 - it should be like in the question.
Below is a fragment of the communication log with the router:
[TCP]> Tx> 13: 55: 02: 459 - 00 7D 00 00 00 06 01 03 00 01 00 02
[TCP]> Rx> 13: 55: 02: 522 - 00 7D 00 00 00 07 01 03 04 00 00 0C 47
[TCP]> Tx> 13: 55: 02: 637 - 00 7E 00 00 00 06 01 03 00 01 00 02
[TCP]> Rx> 13: 55: 02: 691 - 00 7E 00 00 00 07 01 03 04 00 00 0C 47
[TCP]> Tx> 13: 55: 02: 822 - 00 7F 00 00 00 06 01 03 00 01 00 02
[TCP]> Rx> 13: 55: 02: 891 - 00 7F 00 00 00 07 01 03 04 00 00 0C 47
[TCP]> Tx> 13: 55: 02: 991 - 00 80 00 00 00 06 01 03 00 01 00 02
[TCP]> Rx> 13: 55: 03: 054 - FF 80 00 00 00 07 01 03 04 00 00 0C 47
Sys> 13: 55: 08: 055 - Error: Invalid data
[TCP]> Tx> 13: 55: 08: 139 - 00 81 00 00 00 06 01 03 00 01 00 02
[TCP]> Rx> 13: 55: 08: 207 - FF 81 00 00 00 07 01 03 04 00 00 0C 4D
Sys> 13: 55: 13: 225 - Error: Invalid data
[TCP]> Tx> 13: 55: 13: 225 - 00 82 00 00 00 06 01 03 00 01 00 02
[TCP]> Rx> 13: 55: 13: 294 - FF 82 00 00 00 07 01 03 04 00 00 0C 52
Sys> 13: 55: 18: 309 - Error: Invalid data
[TCP]> Tx> 13: 55: 26: 379 - 00 83 00 00 00 06 01 03 00 01 00 02
[TCP]> Rx> 13: 55: 27: 510 - FF 83 00 00 00 07 01 03 04 00 00 0C 60
Sys> 13: 55: 32: 525 - Error: Invalid data