I upgraded to Debian 13 (Devuan Excalibur) and HDMI kept connecting and disconnecting with KDE. I tried nvidia modesetting, nvidia and nouveau with no luck. I switched to X11 from wayland and it is no longer a problem.
Curiously I used to have an issue where Gnat Studio windows would quite often be unusable after coming out of hibernate. That seems to be fixed with X11 or perhaps the upgrade to Debian 13. I guess I was using Wayland on Debian 12 (Devuan Daedalus) too. I’ll update this thread if it happens under X11 but it’s good to know there is a painless fix.
p.s. If Only X11 had not refused the patches from OpenBSD to make it more secure. The Wayland push may well have pushed that into action now with new maintainers and forks. Not that I care whether I’m using Wayland or not, so long as Wayland doesn’t cost me more hours!
They should really have a nvidia-driver-open package as getting it to actually load the open driver module is not intuitive and it didn’t fix the hdmi issue anyway like using X11 does. Probably better to be using it on my card though.