The default onion bind uses -port + 1. With -port=65535 this wraps to 0, so the node binds 127.0.0.1 to a random port and the automatic onion service points there.
Now startup fails with a clear error when that port is needed. An explicit -bind=<addr>:<port>=onion still works, and so does -listen=0.
Added cases to feature_port.py.