Are you sure m.2 was showing in bios before? Some BIOS are weird and don't show the nvme in boot orders, mine doesn't show mine. But it still works.
Do you have a win 10 installer? its a handy boot drive if nothing else
On another PC, download the Windows 10 media creation tool and use it to make a win 10 installer on USB
now its possible its just the boot files that are causing this error
boot from installer
on screen after languages, choose repair this pc, not install.
choose troubleshoot
choose advanced
chose command prompt
type the following and press enter after each