This has happened here. I can't currently remember all the thoughts that had been collected and written here. What follows is some that I can.
I/O posted here would provide us a summary of you current situation, including DE, and whether Xorg or Wayland, at the time it is run.
Most DEs I believe have some GUI tool for managing settings for local displays, among which, which display is primary, typically among others named "desktop settings" or "system settings" or similar. There's also a standalone GUI tool for this purpose named arandr. Settings saved by these methods normally aren't applied until after login succeeds for the user who saved them, though those created by arandr should be convertible to global use.
Global settings usually involve /etc/X11/xorg.con* and/or script(s) that manipulate settings using xrandr or other tools for managing display behavior. These take effect prior to user login, which makes them more fundamental than user saved settings, possibly to the extent that having windows jump to a different display when a wakeup even occurs might be avoided.
/etc/X11/xorg.con* and xrandr I'm familiar with. Whether or to what extent they might be employed by Wayland users I have no idea, as I have yet to attempt to use Wayland purposely in any way, shape or form.