Turns out it is a bug in PyCharm: https://youtrack.jetbrains.com/issue/PY-60819/FLASKDEBUG1-breaks-debugger-when-Python-PyCharm-installation-path-has-spaces#focus=Comments-27-8071749.0-0
Looks like it was fixed in the 2025.2.0 release.
I upgraded to 2025.2 and can confirm that the issue has been resolved.