I discovered an anomaly when using KM to script a third-party application in a special case: The main window of the app is full-screen, and floating windows of that app are on a second (physical) screen—and you're also scripting the KM Editor itself with other Macros. I'm posting this here in case someone else is experiencing the same issue—don't worry, I think that's just how it is.
While working in the KM Editor, Macros that script it are sent to the third-party application instead—but only if floating windows are open on the second screen. Taking the app out of Full Screen mode, or closing the windows, solves the problem.
I believe this is a manifestation of how macOS handles full-screen mode, not an issue with KM.