OK I had this very problem last night, in spades. I think I got Microsataned...
What happened: I hooked up a w11 lappy to my HDMI monitor and did some work. Finished up and disconnected it, back to Ubuntu 22.04.
External monitor was black (but detected under System Settings), internal screen fine. Tried both of my other Ubuntu systems (one file server, one games machine). Monitor also black. Tried every solution in this post, and many others, for about an hour. Nada. There is no NVIDIA in this picture, so none of those things applied. Tried just about all the other suggestions though.
My main lappy is dual-boot Ubuntu and W10 (not upgradable, wouldn't anyway), booted to W10, ext. screen worked! Tried more things in ubuntu...nada.
What eventually worked was power cycling the monitor, i.e. pulling out the power cord--deep zero reset, not turning it off and back on, that did nothing.
The problem went away and I've had no trouble since.
Conclusion: W11 DID SOMETHING to my monitor which only a power cycle could clear. I have no idea what, but I don't see what other explanation there could be. Does W11 mess around with monitor modes or HDMI signals in a way that Ubuntu can't deal with the resulting state? I dunno. Baffling and annoying, and yet another reason for me to loathe microsoft as if I needed one.
If anyone is interested, system is intel Core I-7 with Mesa Intel gfx. I hope this post helps someone.
lshw -c video: it's Haswell-ULT Integrated Graphics Controller and the driver is i915.