I just saw your other post (Error while running opcua gateway locally) where you mention that you are behind a corporate proxy…is it possible that this device is also behind the proxy? If so I suspect that the proxy is handling http/s traffic ok, but not mqtt, which is the cause of the connection error.