No, editing the TCP port and going back to the previous panel shows 4000 again as if I never made a change. After restarting the server multiple times, it’s still port 4000.
However, since I reported this issue, I upgraded to macOS Ventura (13.0) and the issue seems resolved (I cannot fathom the reason). I was able to edit the TCP and UDP ports to 4500 and click the back button and the data was indeed updated. Restarted the service and it seems to be working on port 4500.