Arduino keeps crashing during serial print

If your WiFi or MQTT is disconnected and the watch dog timer has not went off yet and client.poll runs, that's an issue.

MQTT Brokers like to disconnect.