I decided to update the bios today, downloaded the latest available version from the MSI website, flashed successfully but windows wouldnt boot. I (kinda) sorted that, managed to boot into windows but pc started rebooting/giving black screens where cpu fan stops spinning while psu, gpu, case fans spin until I press the restart button manually. So I then downgraded the bios to the one I used before, but the problems continued. Basically windows bootup is longer but it boots, but then reboots/freezes randomly, sometimes after 10 seconds sometimes after 30 minutes.
After 3 or so reboots/crashes windows recovery boots up with the BCD error code 0xc0000098 which is probably caused by me trying to fix it not booting in the first place after the bios flash. Pressing "F1 to enter recovery enviroment" causes the pc to crash/bootloop/black screen again.
Managed to download windows iso to try fixing BCD but it crashed while i was making the bootable usb drive with rufus, so no repair available at the moment.
Tried switching the gpu to another one
Tried taking out ram sticks, different slots
Tried disconnecting all drives except ssd
Cleared cmos multiple times
Tried safe mode, still crashing
Pc was running stable for a year before this without any hiccups until that bios flash.
Build in question:
Ryzen 5 2600
Msi b450m mortar
16gb gskill aegis 3000mhz
Rx580
Bitfenix formula 450w