I don't see any logic for asking the user to pre-generate a custom port, and then giving an error message if/when another notebook (by the same user) is opened. It would make more sense to generate a port on the fly, and risk that another user is using it.
I'll add this tweak to my current PR.