I have recently came across an issue with the MQTT nodes on node Red.
The node red server is set up on an AWS server,
since 2 months I have a problem that MQTT node every now and then (once every 4 days, every 5 days, the last 2 weeks) disconnects and refuses to connect to restart node-red or deploy.
In the meantime nothing is done on the node-red itself so this is not a problem caused by deploy. Node red as of today is in the latest version.
I only mentioned the power supply because it cost me 8 months of chasing my tail trying to work out what was going on.
Can you confirm the uplink is always available when needed?
Is it WiFi or Cable?
Though even if it is cable: if the network goes down: it is down. Just WiFi is (can be) more prone to dropouts than cable.
That is slightly worring. Not in a BAD way, but to me that means (or could) that there is something else causing the problem.
Power spikes. (or drops)
EMP (or similar).
But as I said, I am out of my depth.
Please don't rule things out. I learnt this the hard way.
I stubbornly believed the power supply was good.
In the end I replaced 2. On two RasPis and things have since been great.
Maybe the keep alive (on the channel) time is expiring?
Oh, which version of MQTT are you using?
As much as I don't like hearing this: It could be you have an older version and so the bug exists.
I don't know how to get this information either, sorry.
But may be worth checking.
On another project I helped out with, that had issues with AWS + dynamic subscriptions, MQTT V5 was supported (not all V5 features were supported - but everything V3.11 does was) - this helped greatly.
The easy way is "try it" a V5 connection wont connect if the broker doesnt support it! Thats the easy test.