No connection to Server B after closing connection to Server A

Dear fellow Programmers,

my Program should do this:

  1. Connect to WIFI A

  2. Connect to Server A and send a String of data

  3. Disconnect

  4. Connect to WIFI B

  5. Connect to Server B and send a String of data

  6. Disconnect

Problem:
It does work for the first Server, but does not connect to the second one.(It does connect to WIFI B)
When I switch the order of the WIFIs/Servers the Problem remains the same, meaning it will not connect to the second server.

I am using a NodeMCU board and the Servers/APs are magic Home UFO LED controllers.

TwoWifisTwoServers.ino (5.01 KB)

Found a solution to this unique problem!
Nothing helped until I switched the "lwIP Variant" to "v1.4 higher bandwith" in the tools menu of the Arduino IDE.
Cheers!