NexcloudPi not responding after being turned on for a while

I made myself a nextcloudPi instance on my RaspberryPi 4 recently. I have recognized a pattern that when I plug in the raspberry everything works fine for about 2 hours. Then all of a sudden I can’t ping it anymore. Since I can’t ping it I neither can ssh into it, access via http or anything else. Only if I turn it on and off again it works again for a while. I suspected that this was due to a low voltage so I switched to a 40W charger for power supply. But even there this issue persists. Do you know what could be the issue here?