It started several months ago, so during that time there were multiple updates of KDE, kernel, Nvidia drivers etc.
When I turn off and later turn on the second monitor, both monitors remain black, until reboot. I can still move the cursor, and iirc the cursor may change when e.g. hovering over the places where the input fields are supposed to be.
It’s the same when turning on via the settings or via this script:
Also not sure if related, but another issue I encounter is that sometimes Plasma kind of gets frozen (usually after the screen turns on after being away for some time), I can interact with the opened apps, but cannot use the panel, the launcher does not open etc. systemctl restart --user plasma-plasmashell.service fixes that (does not help with the above issue about the monitors). Nothing in journalctl.
I believe the latest version of KDE has a bug which maybe causing your problem. In settings look for Plasma Style and try using a different style. I am using the Breath style and my problem was solved. If this is your problem expect it to be fixed with the next KDE update.
I am experiencing something like your second issue with Plasma 5.27.11 on Kubuntu 24.04. When the monitors turn back on, the whole system is unresponsive for about 20 seconds. I have the same layout as you with a vertical monitor on the left. When the left monitor is off, the system behaves normally. So I have been keeping the left monitor switched off and only turning it on when I need it for something. Really annoying.
The Breeze style is the problem if the problem is the same one. I am using Manjaro and Breath is the style I switched too. I just remember this is with composting turned on. This may not be related to your problem? I only tossed this out as a possible solution.
Use kscreen-doctor instead of xrandr. I don’t know exactly what the difference is, but there was something when I initially played with it. Also for me, in the rare case that the taskbar freezes on a drag-n-drop, it has its own watchdog timer and will restart after 15-20s. Not sure the manual service restart is required.
I haven’t once encountered this, my external display is 4K and internal 1080p. AMD hardware.
The same with kscreen-doctor
It worked at first, but then the same black screen when I tried it later. Maybe it happens when there is a big delay between off/on, not immediately off and on. (probably the same for xrandr and KDE settings, I think it worked like that some time ago)
I also tried to just run kscreen-doctor output.HDMI-0.enable (after a long delay) without all other settings (position and rotation remain wrong). The screens did not turn black, but everything was somehow completely frozen, I could move the mouse cursor, but could not click anywhere, Alt-Tab etc., systemctl restart --user plasma-plasmashell.service had no effect (triggered it via a Talon voice command).
My big monitor’s firmware is very weird, it doesn’t handle modesets well (it ends up going back and forth at least twice or thrice). To have it turned off / on correctly, my ON script with kscreen-doctor had to explicitly include the rotation and resolution at least (I don’t remember about position).
Try to get into text mode terminal next time (tty3-4 etc. on Manjaro via CTRL+ALT+F3/4; GUI is at F2). And the usual caps lock/numpad status LEDs, do they work or is the kernel hung up? There’s a point, the cursor is probably hardware-accelerated.
There are some ways in which Linux is backwards. Windows 10 made a leap forward with low timeout graphics driver resets.
It was not hung up, there was my alert sound when I triggered the voice command, and then I rebooted via reboot.
So probably just something about graphics.