This error is because the PyCharm debugger has not been updated to work with the version of Python you are using.
Unfortunately, JetBrains have been very slow in adding support for newer Python versions in recent years.
You can try updating to the latest version of PyCharm, but as of 2023-04-25 the PyCharm remote debugger (which is what is used to connect to external processes like Excel) does not support Python 3.10 or later versions of Python.
There are multiple issues related to this in the JetBrains issue tracker:
Many PyXLL users have reported that using VS Code for debugging is more reliable that PyCharm. If you are not able to get debugging in PyCharm to work then that might be a better option.
If you are still having problems after upgrading to the latest version of PyCharm you should contact JetBrains for support.