I have a similar but slightly different issue.
I recently got an imac 2021.
I am connecting an LG ultrawide via HDMI -> thunderbolt cable.
When I turn on my computer, or when it wakes from sleeping it completely stops recognising the LG monitor.
If I go to the system preferences and displays section there is no way to "Detect displays" (holding control does not turn night shift into a different button, nor does going into scaled do the trick).
The only way I can get the monitor to work is by unplugging the cable and plugging it back in twice (from either the monitor or from the thunderbolt, doesn't matter which).
I don't believe it's the cable because before getting this cable I was using an HDMI cable attached to an adapter and was having the same issues (part of the reason I got the HDMI to USB C Cable). I know the adapter is working because I have an External HD hooked up to it, and it constantly recognises that. (Same reason I know the Thunderbolt port is working).
I can hook the monitor up to my old macbook pro (2013) and it works so I don't believe the monitor is the problem here either.
I can still use it, but it means that every time I turn my computer on, or everytime I come back to my computer after locking the screen I also have to go through plug/unplug dance and that's just frustrating.