If I understand correctly. You bought a new 4k monitor to use with your laptop, you extended the screens to use both. It worked for awhile, then problems.
My first guess is that the drivers need to be reinstalled for your graphics card. Download the GTX980 drivers from
Nvidia and move it to your desktop.
In Windows search "Device Manager" go to Display Adapters, right click and uninstall your Nvidia display driver, then restart your computer. When windows restarts reinstall your device driver. Re-enter your display settings into the Nvidia control panel. Did this work?
Guess number two. If you have set your 4K monitor as your default display in either the windows display settings or the Nvidia control panel the settings might reset when you disconnect the 4k monitor from your laptop as windows can no longer find your 4K monitor. Your default display is then most likely set to your laptop display and reconnecting it to the 4K monitor does not restore previous settings. Try setting your 4K monitor as a secondary connected display in the Nvidia control panel and/or windows display settings.