I avoid HDMI ever since I once found I was limited to 30Hz at 4K, and DisplayPort solved that at the time. Today's HDMI standards are a bit hard to follow, so I have just stuck to what's already working.
The P2715Q needs to be power cycled from the wall outlet now and then. If your Mac detects it and sends it signal, but the screen remains black, this is probably the case. I've seen this with several Macs over the years, so I'm comfortable saying it's an issue with the display.
Coworkers have recently observed their U2720Qs occasionally failing to be detected by their 2021 MacBook Pros if they use the same USB-C port to connect to it after sleeping through the night. A reboot of the Mac has clears the issue, and I haven't seen it happen with other models I plug in the same way, so it's likely not the display's fault.
Otherwise, I have to say this setup has been quite reliable across several Mac laptops of different architectures, price points, and pixel densities; lid open or lid closed.