After a while, I found a solution that can be useful to others.
In VS Code press:
CTRL + SHIFT + P
Type or select the option:
Remote-SSH: kill VS Code Server on Host…
Select the host name:
And after this procedure, try connecting again to the host.
That worked for me.