Copy from Linked File - Disconnected Fittings

Hello everyone,

I am trying to copy elements from a linked Revit file using this script, however the result is pipes and pipe fittings that are not connected.
Is there a way around that?