PC keeps restarting all the time for no reason

Recently I did a small upgrade to the processor and RAM. I sold the ones I had, which were at a weak frequency (3200 MHz), and put in 2x16 GB at the same frequency of 5600 each. Besides that, I took the opportunity to clean the inside of the case, which is a must.

The problem is that now the PC keeps restarting, randomly. Sometimes it happens after a few minutes and sometimes after a few hours.

I’m always monitoring GPU and CPU temps and everything looks normal. My 5800X doesn’t go over 50°C in heavy games. The GPU tops out at 70°C. But the PC doesn’t only restart when I’m gaming. Sometimes it’s just on with nobody using it.

I’ve already run a memory test using Testmem5 and it didn’t find any problems.

Could it be the power supply that isn’t handling the workload anymore?

I’ve also enabled the option in the BIOS for the RAM to run at the frequency it was made for.

What else can I test before trying to return the things I bought? Could I have received something that was already defective?