Keyboard maestro-apple script-run 2x to execute

I am very new to the world of automation and makes. I am running the most recent version of Keyboard Maestro on 2017 MacBook pro. I have tried running an apple script to change my audio source as part of the Keyboard Maestro workflow. The script has to be run twice and error pops after the first attempt at running. It states: Macro Cancelled "Can’t get window “Sound Process:”. Any ideas or resources that would help be greatly appreciated. I tested the apple script by itself and I get the same error.

Hard to know without seeing the Applescript or the KM workflow.

FYI Keyboard Maestro has its own forum here if you didn’t know.

I agree with @bowline. It is very hard to know until we see the AppleScript. Since it is throwing the same error when the apple script is run independently, KM is likely not the cause.