Hi. Correct me if I'm wrong: I use the Disk Utility to convert say my downloaded Install macOS High Sierra.app into .cdr and then use Terminal for the command above (if everything fails, I'll use the github .iso one but I think you have to compile the code or install in into Z shell (Bash based).From my archives:
==============
Open the Terminal
Assuming your new image is called ~/Desktop/Master.cdr (the file is on your desktop and called Master.cdr) type:
cd ~/Desktop
(this changes the current working directory to the desktop)
Then type:
hdiutil makehybrid -iso -joliet -o Master.iso Master.cdr
This will create an ISO/Joliet .iso file.
TIP:
Use a text editor to "prepare" your terminal commands.
Then, copy them and paste them into terminal.
Doing this lets you see and avoid typos before they happen.