Latest Mac OS beta has broken Applescript totally

The latest Mac OS 12.5 beta (21G5063a) has completely broken Applescript. This simple command

tell application "Finder" to set theDisks to every disk

now returns Finder got an error: Connection is invalid and my Keyboard Maestro scripts like

tell application "Keyboard Maestro Engine" to set theWidth to getvariable "screenWidth"

also break. Similarly

tell application "System Events"
	set listOfProcesses to (name of every process)
end tell

which is my bread-and-butter in terms of scripting returns System Events got an error: Connection is invalid.

Halp!!

Replies

File a report, and restore the previous release / build.

You could check all the relevant security settings have been granted to all relevant processes.