A logic issue was addressed with improved state management. This issue is fixed in macOS Big Sur 11.3, Security Update 2021-002 Catalina. A malicious application may bypass Gatekeeper checks.
https://support.apple.com/en-us/HT212326
https://support.apple.com/en-us/HT212325
http://packetstormsecurity.com/files/164375/Gatekeeper-Bypass-Proof-Of-Concept.html