I have the exact same problem on the exact same motherboard and the exact same SSD. Mine is even more weird. Got it installed on the m.2 slot. Installed Windows. Got all the updates. Latest build of Windows 11. At random times, when I boot it up it I get the BSOD specific to drive missing ! It literally disappears from BIOS too. Like it doesn't exist. Latest F64 bios. Default settings. Nothing tampered. I power cycle the PC 2 or 3 times (doesn't work on restart) and it just starts ! Get's recognized, boots up...
B450M DS3H (rev. 1.x)
Western Digital SN770 (1 TB model)
AMD 3200G PRO
16 GM RAM (Corsair with activated XMP)
Dedicated video card