I have about 30 Leviton Wi-Fi switches in my house, because when I installed them, there wasn’t a clear leader between Z-Wave, Zibgee, Matter, etc. For years they worked without any issues, but recently they have been losing their network connection, about 3-4 switches per week.
After some experimentation, I set the minimum RSSI for my access points to -80 dBm, which essentially kicks a light switch off the Wi-Fi if it has a poor signal. The goal is for it to reconnect to an access point that is nearer.
I’m happy to say that three weeks later I have not had a single unresponsive switch.