If it's essential to change main display without disconnecting the broken one (?), repeat these steps exactly
- Right click desktop on any of the working displays, choose Screen Resolution
- Press and hold ALT, press SPACE, release both keys
- Press the DOWN ARROW key once, press ENTER
- Press the UP ARROW key once (any arrow key is OK, but let's say UP ARROW to keep instructions simple). This step "glues" the window to the mouse, letting you move it without holding down a mouse button
- Move your mouse to the direction of a working monitor until you can see the Screen Resolution window. Notice please: do this step without pressing any of the mouse buttons or keyboard keys before you can see the window
- Press a mouse button, move windows where you want to
This trick also works if an application or folder window opens on a phantom display, out of visible range.