macOS no longer works in this way. The OS is signed and sealed on a volume that is hidden and always unmounted with a mounted snapshot being the thing that is run and booted. The only thing able to modify that OS are updates from Apple. If you want to wipe the boot drive and reinstall macOS, you boot to a recovery environment (be it on the local disk, or, if you are on an Intel Mac, via the Internet), you run Disk Utility to wipe the drive and then you run Apple's OS installer. Alternatively, if you are on an Apple Silicon Mac, you can put the Mac into DFU mode and restore the OS from another Mac using Apple Configurator 2 (which restores the Mac like it's an iPhone or iPad).
Furthermore, the system volume is cryptographically signed. Your Mac will fail to boot if that is tampered with by anything other than an Apple OS update.