@YazIdo
I think this may be an error associated with an accumulating number of open sockets.
I got the same OSerror: 23 after running the MQTT example for the 8th time and beyond. A soft reset does not clear this, but powering on/off does clear it - and it works again, at least for the first 7 times.
I fixed this problem by adding one line at the very end of the MQTT example.
client.disconnect()