I found this post:
[SOLVED] - M2 NVMe SSD sometimes disappears | Tom's Hardware Forum (tomshardware.com)
but since it's closed i couldn't answer with the solution
If you have a Gigabyte Z370m Aorus Gaming MB (or similar), and a NVMe M2 SSD (mine is from XPG), and it keeps disappearing, just update your BIOS driver (in my case, version F14b ), it just fixed everything.
[SOLVED] - M2 NVMe SSD sometimes disappears | Tom's Hardware Forum (tomshardware.com)
but since it's closed i couldn't answer with the solution
If you have a Gigabyte Z370m Aorus Gaming MB (or similar), and a NVMe M2 SSD (mine is from XPG), and it keeps disappearing, just update your BIOS driver (in my case, version F14b ), it just fixed everything.