The createinstallmedia command (Apple’s official tool) requires the .app bundle, not a raw DMG. If your DMG contains a .pkg installer, you must run the package first to extract the .app to your Applications folder.