This made py work for me without error:
py
$ pipx uninstall pythonpy $ pipx install pythonpy-fork # for example: $ py '2-3' -1 $ py --version Pythonpy 0.5.5 Python 3.12.3
Thanks to @shaik-moeed for the tip!