Keep losing connection to Home Assistant

I really would appreciate help after spending days trying to figure out why I lose connection.
I have successfully booted Home assistant from SSD on the Raspberry pi two times. Both times I’ve lost connection within hours and ended up unable to access home assistant.

The last time it failed, I was finishing setting up the last Zigbee plug when it suddenly lost connection to all addons and configs. I could not reboot because of config error, and I could not access logs. Eventually I lost all connection to the home assistant page and was unable reconnect. Even after a couple of hard reboots.

I suspect this might be a hardware problem, however I don’t see what the problem could be. I bought everything new for this purpose. Now it seems the only way back is to reinstall OS and restore from backup. But then this will probably happen again.

Hardware:

  • Raspberry pi 4
  • Kingston KC600 SSD 256GB
  • ICY BOX USB 3.0 to SATA Adapter for 2.5" HDD/SSD
  • Sonoff Zigbee Dongle (connected in USB 2)