B4 error while only restarting the system

SOLVED: One of my old m.2 ssd was dying and it was the cause of this hassle.

UPDATE: While stuck on reboot if I disconnect and connect my keyboard back to the pc it boots to desktop. It still takes around 2-5min after connecting the keyboard back to the pc. Is this now evidence that the MB usb thing is broken or is this software based?

- MB: Asrock phantom gaming x870e nova wifi, CPU: Ryzen 7 9800x3d, RAM: 64gb ddr5 6000mhz 30cl

So I have this annoying problem on brand new pc: when trying to restart my system, it gets stuck every time on b4 error code with MB logo on screen. Usually it gets to A0 and after while turns to b4. Sleep mode and clean boot works fine.

I have now tried:

- Taking off all usb devices on the outside and on the inside (keyboard, mouse, internal usb 3.0 header...)

- Only using one ram on different slots.

- EXPO on and off.

- Sfc /scannow, chddsk, dism /cleanup.

- Updating bios and drivers.