When you try to run an undefine virtual machine using Virsh, the following message appears:
virsh --connect qemu:///system undefine macos error: Failed to undefine domain macos error: Requested operation is not valid: cannot undefine domain with nvram
Solution:
virsh --connect qemu:///system undefine --nvram macos-manual