I removed and started with a fresh new installation of Anaconda. Just after installation I created a custom environment (cust_env) Both the cust_env and the base environment have Python 3.9. I then installed on both environments Spyder 5.1.
Now, the problem is the following:
If I run Spyder from the base environment, it seems to work and debug my code normally, while if I run it from the cust_env, when I enter in debug mode the console apparently does not answer anymore (the debug prompt does not appear and you must restart the kernel to have it back again).
I also tryed with different versions of Python (3.7.x and 3.8.x) and of Spyder (4.x, 3.x) and the behaviour looks identical.
I cannot understand what might be the difference which does not allow to use Spyder in an environment different to the base one.