Meaning the advanced security is getting in the way. This is one reason why I suggested starting over after a backup. I have no idea what caused the problem originally but it might have been there quite a while. Backing up and doing a full clean install would be recommended.
If it's Intel with T2 Security Chip you'll need to enable USB booting and you'll need to grab the installation source from this actual Mac and create a bootable thumb drive on this Mac.
If it's an Apple Silicon Mac (M1 / M2) then you'll need another Mac and a Thunderbolt cable. You can put the Apple Silicon Mac into DFU mode and use Apple Configurator 2 on the second Mac connected to the first Mac via Thunderbolt and it should show up in the second Mac's Apple Configurator. Then you can restore the OS from scratch.
Then you restore your data. Yes, royal pain in the neck, but you'll have a working and trustworthy system afterwards.