Program is opening for a quarter of a second and then closing instantly
Open the Console app and leave it running. With the verbosity of recent versions of macOS, I'd be very surprised if the application doesn't leave log entries. Or at the very least the operating system doesn't leave log entries about it.

You could also leave a Terminal window open with the command sudo fs_usage | grep open running. This command will give you a list of every single file that is opened on your Mac. Which will be a surprising amount, but if you stop it (hold down CTRL and hit C) and check it immediately after seeing the application appear and disappear you should see what it is and where it is being loaded from.