As I am stubborn and obstinate, I finally found the source of the trouble with the MKR Wifi 1010:
It does not accept "Serial.read", which causes all the problems described above.
After replacing this command with "Serial.parseInt" everything started working!
Of course, I had to rewrite the whole Serial communication, but the result is positive.
I hope this information can be used by others...