Found the solution for my scenario, the app was quarantined, this fixed the issue:
xattr -r -d com.apple.quarantine ./XXXX.app
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: