When running the installer on macOS 12.2.1, Mac mini (M1, 2020) the installer returned 'The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.'.
In /var/log/install.log I found an error in ./postinstall
when unpacking the ARM toolchain.
I ran the installer three times, and the third time there were no more errors. I have the log file available if necessary.