I have flashed my Prime B450M-K motherboard BIOS from version 3802 to version 4202. I have flashed it because my computer was randomly restarting again without any warning (it did the same thing a year ago but stopped after few days) so I though flashing a newer BIOS might fix that issue.
After the flashing was complete, I changed BIOS settings and when I tried to boot into Windows 10 from a NVMe drive, it was stuck on ASUS logo, with no loading dots. After few tries, it did manage to show a blue screen saying that Boot Configuration Data doesn't contain valid information for an operating system.
I thought that was the issue that it didn't boot so I have tried to boot the Windows installer from a USB to repair the BCD, but PC was again stuck on ASUS screen and sometimes it has shown a plain blue screen with no text or a BSOD.
By trying to boot Linux from another drive from GRUB the PC restarts with no warning screen. Same thing sometimes also happened while trying to boot to Windows.
I have did CMOS reset, even kept the battery out for few hours, tried changing CSM, secure boot and some other settings, tried to downgrade the board, unplugged every drive that could cause any issues but same thing goes on.
What could cause this? I think CPU is fine because it has always ran with no problems and RAMs must be fine too because I have tried switching between slots, using old RAMs and it always did the same thing.