I have the same problem here on two different computers:
I am trying to launch a script from my application and it fails with NSAppleScriptErrorNumber = "-2147450879".
This happens with macOS Catalina on an Intel Mac Mini and Monterey on M1 Mac Mini. Other machines here do not have that problem. It also happed to some of our customers.
When creating a new admin user, it runs without an error when using that account. But that is not a solution for me and especially not an option that would help our customers. I need to get it running on the main account as well.
What was interesting: After creating the second Admin accound and restarting the Catalina Mac, it worked on both Admin accounts. But on the first account, the error came up again after the next restart.
Could you shed some more light on what might be causing this error, and what settings, permissions etc. I could check to find out what is different between these two Admin accounts?