What helped me was erasing the port environmental variable from Railway. The Railway automatically assigns a dynamic port, and there is no need to write a hard-coded value.