He
I don't fully understand why but here is a script that is changing the size and position of the current window to the previous current window
from AppKit import NSApp
# get all ordered windows
windows = NSApp().orderedWindows()
# get the size of the window
(x, y), (w, h) = windows[1].frame()
# set the size of the window
windows[0].setFrame_display_animate_(((x, y), (w, h)), True, False)
good luck!