Esp32 not available every random time

Hello friends. I have a problem with an esphome node. I have an esp32 that is doing a check on an aquarium and every random time it becomes unavailable. I don’t know what causes this. The problem is that, for example, it stops controlling the temperature and can start to have a low temperature in the aquarium. I made an automation so that it notifies me when it is in that state for more than a minute but I don’t know what else I can do to get it out of that state. I have to restart the esp32 for it to reactivate. Could it be because the connection of the esp32 to the relay board is with dupont cables and not soldered? Can the esp32 itself detect that it is in that state and restart? Thank you very much