It's caused by a quarantine flag: https://discussions.apple.com/thread/253714860?sortBy=rank
To fix it, open a console and type
$ xattr -c <path/to/application.app>
(And yeah, that error message is borderline malicious from Apple's side, just terrible user communication that makes users think the app they downloaded is brolen).