This usually can be fixed by command:

Set-VHD “D:\VM\maindisk.avhdx” – PartentPath “D:\VM\maindisk.vhdx”

You may get back an error “There exists ID mismatch between the differencing virtual hard disk and the parent disk.”

If you get that you can use -ignoreidmismatch flag

Set-VHD “D:\VM\maindisk.avhdx” – PartentPath “D:\VM\maindisk.vhdx” -ignoreidmismatch