I had a similar problem—after upgrading from Monterey to Ventura (13.2.1), my workflows using osascript/JavaScript all failed to run.
It took a bit of diagnostic and search work, but I found a simple solution. It applies only if you've installed the 3rd-party app Script Debugger. If so, try deleting the "~/Library/Components/Script Debugger.component" folder it installs. This immediately fixed the problem for me (no reboot required).
For more, see my answer on Ask Different: applescript - OSA Script failing for JavaScript All the Sudden - Ask Different.