An ISO image expects a specific filesystem (typically ISO 9660 with Joliet or UDF extensions). Your extracted folder must be arranged for disc bootability. For a macOS installer, you need to create a bootable layout:
hdiutil create -o /tmp/macOS -size 14G -layout SPUD -fs HFS+J Mount the Image how to convert pkg to iso
: Open Terminal and create a blank DMG file that will act as the container: An ISO image expects a specific filesystem (typically