Create a sub-composition with some published ports
Erase one of the published ports (input or output)
Create a new published port with the same name and place as the erased port (input if erased one was input, output if erased port was output)
Result is the digit "2" appended to the port title.
Rename port to erase the "2" and it becomes a "3"
Have you found a workaround?:
It means that when reworking a sub composition you can break wires coming out of it in the parent compositions because it forces a port title change on you which, which obviously breaks the link to other nodes in the parent compositions. Forced to rewire them, and an annoying port name too.