To replicate, create a Process Group with the following components:
InputPort -> LogAttribute -> OutputPort
Then move to the higher group and add this to Version Control.
Next, import another copy of the same group.
Connect the first child group's OutputPort to the second group's InputPort.
Add a GenerateFlowFile and connect it to the first group's Input Port.
Add a LogAttribute and connect the second group's OutputPort to it.
Now, version control the outer group.
At this point, all should behave as expected.
Now, if you import a second copy of the outer group, the newly imported group has connections going to/from the wrong ports. It appears that NiFi is not properly mapping a port in a child group to the appropriate child group if there are multiple copies of the (independently versioned) child group.