That usually, maximize is next to the close button and all buttons are usually on the right side of the window bar

Oh that's just how it is on Windows though. Seems like on mac the minimize button provides a buffer between maximize and close. I'd rather accidentally minimize if I'm trying to maximize than close the window