I had this very same error, but under different circumstances than you.
In my case I was moving existing vhdx file to a new path (actually new drive). To continue native booting into it I had to edit boot records in BCD to point to the new path. There is official guide for this scenario, but it is missing one critical command - which may help you.
The official guide
The official guide Add a Native-Boot Virtual Hard Disk to the Boot Menu can be summarized as:
:: Add boot record by copying and modifying current record
:: This command gives you new {new-guid} you will use below
bcdedit /copy {current} /d "Description here"
:: Update copied record with the new path N:\windows.vhdx
bcdedit /set {new-guid} device vhd=[N:]\windows.vhdx
bcdedit /set {new-guid} osdevice vhd=[N:]\windows.vhdx
Fairly easy, but it didn't work; I was getting the same error as you.
The fix
To fix it I had to mount the vhdx from its new path N:\windows.vhdx
to disk letter O:\
and run this command:
:: bcdboot does two things:
:: a) it creates or repairs boot files in specified location
:: b) it creates or updates boot record in BCD
bcdboot O:\Windows
Then you can unmount the vhdx. It didn't really made huge difference in bcdedit /v
listing -- basically it just updated the copied boot record with a new guid instead of previous {new-guid}
-- but something got fixed in the boot records behind the curtain and it started working.
Note: you could argue that bcdboot
actually fixed the vhdx file, namely the boot files in O:\
, but that could not play role in my scenario, because I discarded the vhdx I ran the bcdboot
on and instead used another copy that was never treated this way.