The executable was signed with invalid entitlements.
The entitlements specified in your application’s Code Signing Entitlements file do not match those specif
In my case, the app main Target's Team was different from Tests' Target Team. Changing the Tests' Team to the same Team as main Target's solves the issue.