The solution

After troubleshooting the issue and a lot of Googling, I checked which other processes were listening to the port 9000.

sudolsof -iTCP -sTCP:LISTEN -n -P

It turned out the php-fpm was listening to port 9000 and was receiving the debug connections from my editor. It turned out that I had installed php with php-fpm via brew and brew had configure the php service as autostart.