I can’t think of any obvious cause. The only things I can suggest, if you haven’t already tried them, is to restart the problem machine to see if reloading AppleScript solves the problem and/or copy the script file over from one of the good machines in case the one on the problem machine’s become corrupted.
FWIW, I tested the following script on my 2023 Ventura Mac mini without issue. I tested the script on both Script Editor and Script Debugger.
set myURL to "https://www.macscripter.net"
tell application "Safari"
activate
open location myURL
-- instead of above line try the following which makes new window
-- make new document at end of documents with properties {URL:myURL}
my finishedLoading(myURL) -- showed in log "(*finishedLoading is executed: https://www.macscripter.net*)"
end tell
on finishedLoading(URLtoLoad)
log "finishedLoading is executed: " & URLtoLoad
end finishedLoading