The issue is caused by "ghost" roles for the affected VMs on the Failover Cluster Manager server or the VMM server. When our script discovers the VM names, it checks the VM list in the registry of the Cluster Manager or the VMM server at HKEY_LOCAL_MACHINE\Cluster\Resources
The behavior may manifest itself if a VM has been manually removed from inventory. By design, Hyper-V should be updating the registry appropriately. If this does not happen, the "ghost" VM has no VmID under "Parameters". Here are two examples of invalid configuration:
[HKEY_LOCAL_MACHINE\Cluster\Resources\8ad1692b-3d65-4716-8517-e8092c469af4]
"Name"="Name of VM Configuration"
"Type"="Virtual Machine Configuration"
"SeparateMonitor"=dword:00000000
[HKEY_LOCAL_MACHINE\Cluster\Resources\8ad1692b-3d65-4716-8517-e8092c469af4\Parameters]
"DependsOnSharedVolumes"=hex(7):61,00,62,00,63,00,33,00,36,00,33,00,32,00,63,\
00,2d,00,37,00,36,00,36,00,66,00,2d,00,34,00,38,00,61,00,62,00,2d,00,39,00,\
36,00,61,00,36,00,2d,00,37,00,35,00,62,00,61,00,63,00,65,00,63,00,65,00,34,\
00,63,00,32,00,38,00,00,00,00,00
or
[HKEY_LOCAL_MACHINE\Cluster\Resources\e27f0edb-66c2-4be0-a1c9-3a8545e6e15f]
"Name"="Name of VM"
"Type"="Virtual Machine"
"SeparateMonitor"=dword:00000000
[HKEY_LOCAL_MACHINE\Cluster\Resources\e27f0edb-66c2-4be0-a1c9-3a8545e6e15f\Parameters]