See Node-RED “Error: 14 UNAVAILABLE: Connect Failed” when using node-red-contrib-ttn which suggest to use Node-RED’s built-in MQTT nodes, rather than the advanced/complex one offered by TTN.
(Indeed, I’ve always used the built-in MQTT nodes, without any problems.)