Facing OSStatus Error when Cloning APFS Bootable Partition for Mac Pro

I’m using Disk Utility in Recovery Mode to save a fully configured OS installation as a disk image for future restore.

It keeps failing with errors like:

Restoring

Verifying

Inverting target volume…

APFS inverter failed to invert the volume - Invalid argument

The operation couldn’t be completed. (OSStatus error 22.)

macOS Mojave may have problems restoring disks. You can create a macOS Monterey bootable USB and boot from it to perform the clone.

  1. Boot from the macOS Monterey bootable drive.
  2. Open Disk Utility and create an empty APFS image with a single partition and read/write access. Ensure it’s larger than the source volume.
  3. Select that disk image from the left and click Restore.
  4. Restore from the source volume.