I got a bit of the same issue with my Node-Red sending payload to Losant using MQTT.
I'm using some LORA sensors. They are connected to Node-Red via http and node-red do the payload transcription for losant and send it.
It worked great using a single MQTT output for one device. But since I'll like to have a single output for all my devices just changing the topic to know witch one it is. It seams like a Gateway and some peripherals will be perfect. But now my MQTT node does not work properly and have a lot of disconnections every 5 secs.
I tried changing the "keep it alive" for more or less that the stock 60s and it didn't change anything.
Maybe i'm a bit confused with the gateway thing. The topic must be "losant/perippheralID/state" and the MQTT node ID must be the one from the gateway, right?
If someone could help me it will be great