This usually happens if the VM is still in a transitional state like stopping, snapshotting, or if there are attached volumes or snapshots linked to it. CloudStack requires all dependent resources to be detached or removed before a VM can be fully deleted. Once everything is cleared, the VM can be removed successfully.