When run in the mac script editor it executes fine and opens a new tab in Edge one would expect. However, when I add it to a KM macro with the Execute AppleScript action nothing happens. I even have the display results selected and I see nothing. I have placed display text actions immediately before and after the AppleScript action and they both display so I am sure that it is running it.
Perhaps you should check the Accessibility and Automation settings in the Security and Privacy systems preferences on your Mac to make sure KM has the necessary permissions.
I have to say, I tried out your AppleScript first in Script Debugger and when I ran it I was asked to grant permission to Script Debugger to control Microsoft Edge. I Oked that and then tried KM with no problems.
I’m no AppleScript expert (believe me!) but the next step is for you to show us the macro that is causing the problem - in much the same way I showed you mine Without that there’s no way of knowing exactly what’s going on.