When using multiple monitors on macOS, panels, windows, and other interface elements that you've placed on a secondary monitor move back to the main monitor after switching to other applications and back.
Solution 1: Deselect Displays have separate Spaces in Mission Control.
Solution 2: Assign the application, such as Photoshop, to All Desktops or None.
Note: If you do not see the Assign To section in Options, it's possible that you disabled additional spaces. Create a temporary space so that you can see the Assign To options. For more information on creating spaces, see Work in multiple spaces on Mac.
MacOS gives you the option to assign an application to a specific Space. Doing this forces an application to always opens in this Space, which helps with organization and reducing screen clutter. However, all elements of that application must also exist in that same Space. The OS allows you to temporarily move elements to another screen while the application is active, but when switching to another Space or application and back, the OS assigns all elements back to the designated Space.
Other issues that are solved when this option is deselected are:
Sign in to your account