The computer is not intelligent enough to recognize the just downloaded application comes from your own computer (uploaded by it)…
I tried (years ago) and get this behavior.
Copying the application into a MemoryStick and installing it from there (El Capitan or lower) does not behave this way.
Can you try that with (say Big Sur) a more recent OS version ?
BTW: same apply to me on Windows… before I was able to create a sharing folder with VirtualBox. I uploaded the application to test on a Web file server and downloaded it inside my Windows 10’ runnning in VirtualBox.