Node.js and net limitation?

Did you restart Node-RED after making the change?
settings.js are only read the one time on startup.

Did you try using a catch node with the TCP node to catch any errors it produces?

Also, I totally agree with you on avoiding hacky work arounds when the port locks up, but if it moves you forward in your testing… Restart NodeRED After PAC Control Download