Happened to me too. Second monitor was working fine on Monterey and Macbook Pro M1 2021 then one morning would not detect secondary monitor (Acer 32inch 4k) via USB-C. Worked fine via HDMI.
Tried lots of things and lost 2 hours. Then at the end reseting NVRAM/PRAM worked: https://purplecomputing.com/tech-how-to/how-to-reset-nvram-or-pram/#:~:text=Shut%20down%20your%20Mac%2C%20then,Mac%20might%20appear%20to%20restart.
Before resetting NVRAM/PRAM I upgraded from Monterey 12.1 to 12.2.1.
Also ordered 1 new USB-C to DP cable :/ since I did not know what else to do. Looks like lost $40.
Hope you make it work, since it is really frustrating that such a basic thing does not work. C'mon Apple engineers.
Topic:
App & System Services
SubTopic:
Core OS
Tags: