I just built a new PC and I am having a similar issue and it has been driving me crazy. I have benchmarked my GPU, CPU, Memory passed tests, temps are good, checked event logs, did a clean install of Windows, updated BIOS, turned off XMP/EXPO, not overclocked anywhere, reseated the GPU and checked all PSU connections.
Randomly my monitor will black screen and PC will reboot. The GPU will show up under devices and audio will play but after the reboot I have no sound and no GPU detected. I then have to use DDU and reinstall drivers for it to work for maybe 30 min if I'm lucky before the next crash.
CPU: AMD Ryzen 7 7800X3D
Cooler: Corsair ICUE Link H150i RGB
GPU: ASRock Phantom Gaming Radeon RX 7900 XT 20GB
Motherboard: Gigabyte B650 Aorus Elite AX V2
RAM: 2x TEAMGROUP T-FORCE DELTA RGB DDR5 6000 MHz 16GB
SSD: TEAMGROUP MP44L 2TB M.2
PSU: Be Quiet! Pure Power 12M 850W
Case: Hyte Y60