Only one external monitor gets video signal, even though two external monitors get detected

wanted to know if there is any workaround. Seems like a common issue. For example another thread with people reporting similar issues, and this was 3 years ago. The difference is that in my case its the monitor connected to laptop’s usb-c/display-port that gets issues if laptop’s HDMI port is in use. Again, only in ubuntu (i.e. using linux nvidia 535/545 driver). In windows11, everything works fine.