I migrated a few virtual machines from standard switch to distributed switch. But somehow, a couple virtual machines are still showing in the port group of a standard switch (in Inventory/ Networking) which I have removed. It turns out those virtual machines all have snapshots. In the snapshot, the VM still uses the standard switch. That is why you see there are two VMs in the inactive standard port group in the following diagram.

The fix is simple –just remove the snapshot if you don’t need them. If you still need them, it is fine as it does not affect the running virtual machine at all. Just remember to change the network settings accordingly when you revert the VM to a snapshot.