Tested some more: The issue does indeed not appear when using /server. So I guess the problem is somewhere in the Options dialog, as mIRC only attempts to use wrong ports when using the select button under Connect -> Servers and then connecting via the toolbar button.