MQTT does not work well with two brokers

I have two MQTT brokers on my Chirpstack server (which is mounted on an AWS EC2): the local one and a remote one on AWS.

First, I set the local broker in the chirpstack-gateway-bridge.toml file at the Generic MQTT authentication section, and I can see the configured gateway connected to the Chirpstack web interface.

If I configure the remote, I correctly receive the events on Node-RED.

Then, to be connected to both, I configured them as follows:

servers=[
“tcp://127.0.0.1:1883”,
“ssl://xxxxxxxxxxxxx-ats.iot.us-east-1.amazonaws.com:8883”
]

When I do that, the gateway appears disconnected on the Chirpstack interface and does not receive anything, but in Node-RED, I still receive events correctly.

Just in case I reversed the order of the servers by placing the remote one first, which worked for a few moments on both clients, I could see the connected gateway and its events in the Chirpstack interface while receiving events in Node-RED from the remote broker.

But after a few moments, without moving anything, the gateway appeared disconnected again on the Chirpstack interface, but in Node-RED, everything continued correctly.

Will it involve saturation in the sending of events or something like that? Do we have to configure waiting times or something similar?

Thanks in advance to anyone who can help me with this issue.

That is not how it works. It will only connect to one of them, the others are use for fall-back.