Mosquitto MQTT continually disconnects and reconnects becoming unstable

Hey, I tasmotized multiple sonoffs, and they are on autodiscovery, for most of the time i face no problems with the disconnection, but some devices are being used as binary sensors, when the electricity comes for example. I’m facing a problem that sometimes they keep on disconnecting and reconnecting for around 200 times in an hour. How can i solve this issue.

I updated mosquito broker, and tasmota version of the device.

Note that i dont always face this problem, but the automations related to it become very hectic because of the instability of the sensor.

Home Assistant 2023.10.3
Supervisor 2023.10.0
Operating System 9.5