Enabling or disabling a secondary monitor on KDE with Nvidia almost always disabled/crashed/reset the desktop effects or compositor. It was simple to get them back with CTRL+MAJ+F12 key combination, but it wasn't ideal.
A simple fix was to enable a desktop effect in KDE called background contrast. It is apparently an old known bug in KDE.