For anyone wondering, this has never been fixed, and still remains an issue with the M2 Pro mac mini in 2025.
The troubleshooting advice people usually give makes zero sense. It works just fine after turning off the primary monitor, waiting until the secondary comes on, and then turning on again the primary one. The bug is not present with other devices.
It confirms that this is a bug with the M2 Pro mac mini, and not an issue with cables, monitors, or the like.