Sorry, I don't have a direct answer/solution for your issue.
I can say that if Magnet (or any app) is using non-standard windows, KM will likely have trouble directing output/actions towards that window.
IAC, KM has extensive window manipulation actions.
Here's a macro set as an example: