For example, Chrome has it on the left whereas the settings have it on the right.
It was because your system had more than one settings location for button-layout With dconf editor, you can change the layout manually /org/gnome/desktop/wm/preferences/button-layout and here /org/pantheon/desktop/gala/appearance/button-layout