I erased Macintosh HD in disk utility, now I can't reinstall macOS Big Sur
If the recovery mode on your Mac won't let you install macOS, then the next trick is &quot;Internet Recovery Mode&quot;. See this web page for a description of how to use it to reinstall your Mac's OS: https://www.macworld.co.uk/how-to/recovery-mode-internet-3636668/#internet%20recovery
The important thing to note here though, is that you need to be connected to the Internet in order to use it (the clue is in the name) and that a large download is involved, so it will take some time to start the recovery mode. I think it's about 12GB or so.