Because Keyboard Maestro just runs the script as you've written it with no feedback.
(Unless you display the result in a window and have “Include Errors” checked in the gear menu of the Execute an AppleScript action.)
Script Editor and Script Debugger provide feedback on and results for code that is run and tells you when you've made an error.
In Script Editor look in the Result panel of the script window – and try opening the Log History window before running a script.
In Script Debugger there are quite a few more options:
View > Result & Variables Tab View > Show Event Log View > Show Event Log in Window View > Show Event Log Result Explorer Script > Show Result Explorer Window Script > Event Log in Window
You should always write, proof, and debug AppleScript in a proper AppleScript editor.
Only then should you move your code to a Keyboard Maestro action.