Firefox is entirely misfeatured when it comes to ports.
On my desktop, it will no longer let me connect to http://nas.local:XXX because i have previously used https://nas.local:YYY for something else. It refuses to permit http and https to coexist on different ports on the same hostname.
On my phone, ports are banned. Not all ports, just some. The list is arbitrary and secret, and cannot be modified on release builds.

