I suspect your issue is not related to Script Debugger but to the do shell script command, and the environment it runs in. See this for details, particularly the section ‘Why doesn’t do shell script work exactly like Terminal?’:
Hard to tell without knowing what the file contains. It certainly doesn’t contain what you posted above, because the log command doesn’t return any result.
Have you tried just passing the full path to do shell script?
@ShaneStanley it does indeed contain just this simple line. See the screenshot below.
Your suggestion did get me thinking though. I hadn’t noticed before, but the SD message said that sh could not find python3. I changed the call to log (do shell script "/usr/local/bin/python3 -V") and SD reported (*Python 3.7.6*) in the log viewer!
Apparently when running from the bash command line, osascript inherits the bash environment vars. So, the question is why does SD not use the user-preferred shell (along with its defined environment vars)?
Because that would be providing a way for people to write applets that work in SD but fail as soon as they saved them as applets, or ran then from any other app. From a portability perspective, it would be a disaster. Scripts run via osascript are the exception rather than the rule.