Can you post the full code and/or the project and/or link to the documentation page? It's hard to say what could be causing the issue otherwise.
Looking at the code that is visible and the post, one thing that could be potentially causing the issue is the 4000 port being used by another program. That could explain why the project was working, but is suddenly not working with no changes.
Maybe try changing the port to another number and see if that works? If that doesn't work, maybe try restarting your computer, as that could free up the network port(s).
Another thing that could be potentially causing the issue is connecting to the server before you connect the signals. Perhaps if the signals are not connected, Godot creates an error? I doubt this is the issue, but it might sometimes strange errors can arise.