Just thought I should give you a heads-up: if I attempt to run a pre-M1 createInstallMedia on my M1 Mac running Monterey, I'm greeted with the response of: "Killed: 9".
This breaks pretty much every conversion script out there that depends on createInstallMedia, including yours. So a new requirement of createInstallMedia appears to be that you're running an x86 version of macOS.
it is not possible to use this newer version of the macOS Sierra installer application.
It's possible to use the updated macOS Sierra installer's createinstallmedia after making a simple modification: change the installer's version number back to 12.6.03 by running sudo plutil -replace CFBundleShortVersionString -string "12.6.03" /Applications/Install\ macOS\ Sierra.app/Contents/Info.plist.