Stuck on loading screen in the morning

I installed HA on an RPi 4 with 2 GB RAM and official power adapter and class A2 SD card, but
quite often what happens is that around 23:30 or later (can vary I think), Home Assistant stops working. Automations stop working. And HA is not accessible through the app or any browser.
It is stuck at the loading screen. And wants to retry connections many times but never gets it.
I use duckdns for him.
Neither the internal IP adress or the external
adress works.

Not so many integrations.
Most RAM consuming stuff/unstable stuff might be
Aarlo cam intergration from HACS.

I have to reboot it manually to get it to work.
I set up automated reboot at 02:00 every night, which made the RPi more stable, but the problem still happens at least 3 times a week.
Anyone been through this before?

Have you tried another/new SD card?

No I have not.
It doesnt feel to me as an SD-card issue since this only happens at night, never at random times. But I am not an expert and of course I should try it, thanks for the tip.
Can you tell me why you think it will help? Does the software do anything with the SD-card every night?

The SD cards are just a known weak point if they start to fail. Cheap/easy fix if that’s it.

I have a 3B (so less RAM) and have had some issues with that forcing a restart pretty predictably when it maxes out and periodically HA won’t seem to recover from the restart. I also have the Aarlo addon from HACS and have pondered disabling it for a while to see if it’s the source of anything, as it’s been the most troublesome integration in general.

Should also mention that I previously had my router reboot every night, and a few hours afterwards my HA Pi would crash pretty predictably (guessing that’s not the case for you, but figured I’d throw it out there). Clearly something doesn’t like losing the internet briefly and can’t recover.