Try using this open-source script that creates a bootable disk image as well as an ISO file.
https://github.com/rtrouton/create_macos_vm_install_dmg
I just used it and I asked it to create the ISO in addition to the .dmg. I created a custom virtual machine for macOS 12 and attached the ISO to the the CD/DVD drive.
Booted the VM and the ISO booted to recovery. It didn't seem to like NAT networking (couldn't seem to find the Apple servers). I switched to Bridged networking and it's now installing.