Accessing SWO on STM32H743 hangs the CPU
After a lot of testing, I happened to try it with the boot configuration that uses 64 MHz HSI oscillator. That worked!
So after further testing, it finally saw this piece of the clock tree documentation:

Whenever STM32H7 is configured to use PLL1 P channel as the CPU clock, the trace clock is automatically switched to PLL1 R. I had the R channel disabled because I'm not using it for anything else, which then caused any access to the trace components to hang.