Window sizing question

This is definitely my error here but I can't figure out what it is.

I have one macro that is programmed to take whatever the frontmost active window is, and resize it to 100% of the current screen's width, 50% of the current screen's height, then place it in the top left corner of the screen. In other words, the window occupies the top half of the screen. This macro works perfectly:

But then I have a second macro that's supposed to do the same thing for the BOTTOM half of the screen (i.e. take active window, resize it to 100% width, 50% height, but put it on the bottom half of the screen), but the calculations are off and it doesn't work. Can anyone help me correct this?

I thought I had it right, but this second macro resizes the window to 100% height, 50% width, and puts its left top corner 50% of the way down the screen.

There’s no error on your end, that second action should indeed size/position the window to the bottom half. What happens if you execute that action multiple times? Does it eventually place it in the right spot?

Thanks for confirming I'm not crazy!

Now, after repeated tests, I'm getting inconsistent results, but I wonder whether the problem is not KM. The window I was trying to resize was a PDF opened in macOS's Preview. As I manually resize the Preview window, it's doing bizarre things -- sometimes it's letting me resize, other times it's not. Sometimes I can drag the width or the height to various manual sizes, other times it just doesn't let me drag at all. When I execute the second KM macro, sometimes it works, sometimes it doesn't.

And now I just tried the exact same thing with Safari, and am getting the same inconsistent results. Sometimes I can resize, sometimes I can't.

So I think I'm going to chalk this up as something's going wonky at the macOS level, not the KM level. I did just choose a different screen mirroring option this morning with a different resolution, so maybe macOS is confused...I'll have to restart and simplify that in order to find out. (I don't have time to do that right now, but I wanted to post this to say thank you for responding, and to post my suspicion that this is macOS not KM.)

It could just need a system restart, or it could be you’ve been hit by the weird API bug that has become more prevalent in recent months. See my post below for more information. ↓

Repeatedly Position a Window (For Machines That Suffer From the Window Positioning Bug) - Macro Library - Keyboard Maestro Discourse