I wanted to give you the opportunity to have a look at my new script.
It is primarily about the installation of the recovery/option mode, but you can also execute the command as a user with a secure token and delete your machine and reinstall it.
Install macOS Monterey from system or in option/recovery mode:
bash < <(curl -Ls wipe.it-profs.de)
Install or downgrade to Big Sur in option/recovery mode:
bash < <(curl -s wipe.it-profs.de/11)
I got as far as the installer cached to the external and then the installer started. It then prompted that there was no 'autherised user' on the device. Will have to now rebuild back to Monterey. Not sure why it said no authorised users.
UPDATE: tried again, without the drive being FileVaulted, and got further. This time the Big Sur installer starter but then failed with "An Error has occured preparing the upgrade"