The problem was not caused by router settings or distance between the board and the router or a weak USB power plug or delay settings in the program...
It was a firmware issue !
I checked the firmware version of my MKR1000 board using the standard updater procedure in the IDE.
I found my firmware version was 19.4.4 and I could upgrade to 19.6.1. (Board version MR510PB).
Now the WriteSingleField program is working 100% OK !