This is a fairly well-documented issue, dating back at least a couple of years. In my experience, it seems to appear out of nowhere, and can be related to an OS upgrade, or completely random. One of the times I experienced it on a previous machine, reinstalling the OS permanently fixed it. But if you don’t feel like doing that, there are workarounds you can try as well.
- Window resize works inconsistently (dependent on App and Mac) - Questions & Suggestions - Keyboard Maestro Discourse
- Possible Bug: Manipulate a Window Interacts Differently (And Unreliably) With Different Applications - Questions & Suggestions - Keyboard Maestro Discourse
- Getting Started with macOS Shortcuts - Questions & Suggestions - Keyboard Maestro Discourse
Note Peter's comments on one particular post: