Finally discovered the answer. Hope this helps.
You need to disable both Gatekeeper (enable Anywhere) and SIP(System Integrity Protection).
To disable SIP:
Step 1: Enter macOS recovery mode. Depending on whether your computer is an Intel or ARM chip (M1, M2, M…), there will be different ways to enter recovery.
- ARM chip: Turn off the device completely, press and hold the power button until the screen displays the words “Loading startup options”, then release the power button.
- Intel chip: Click the Apple icon on the menu bar, select Restart, then press Command R and hold until the startup screen appears.
Step 2: Open Terminal from the menu bar above. Suppose you do not immediately see this screen when entering recovery. In that case, you may have to go through steps such as selecting Options, selecting User, and entering the password to open the device.
Step 3: Enter this command line into Terminal to disable SIP on Mac. The system may ask for a password to disable SIP; enter your device’s password and then Enter.
csrutil disable
You may be asked by the system, “Allow booting unsigned operating system and any kernel extensions for OS Macintosh HD? [y/n]” , then you need to enter “y” and then Enter to continue.
Step 4: Check the results returned by the system. If you see “Successfully disabled System Integrity Protection” or “System Integrity Protection is off” in Terminal, you have successfully disabled SIP on Mac. Now enter the reboot command and then Enter to reboot the device.