USB-C Displayport doesn't work until HDMI is plugged in too
I'm trying to connect an external monitor (AOC Q27P2CA) to my 2021 Macbook Pro 14" M1 running Monterey using a USB-C cable, but the monitor isn't detected. The weird part is that if I also connect using an HDMI cable, the Macbook then detects the monitor twice. I can then unplug the HDMI cable, and the USB-C connection works perfectly, including charging the Macbook. Until the Mac goes to sleep, at which point it loses the monitor, and when I wake it up, I have to plug in the HDMI cable again to trigger detection of the USB-C connection, then unplug the HDMI cable again.
It seems as though the Macbook needs to have a monitor connected via HDMI before it can detect a monitor connected via USB-C. I could just use HDMI, but I would ideally like to use the monitor's USB hub and charge the Macbook all just with a single cable connecting them.