The problem is that the Panel with the Panel.itemArray is a “Spot” Panel. Such panels always have a main element and then one or more subsidiary elements that are positioned at spots relative to the main element. GoJS Panels -- Northwoods Software
But your template is replacing all of the elements of the Spot Panel. Did you want to position the second and third ports relative to the first port? Probably not. Either change the panel type to something else or add a first element marked with isPanelMain set to true, which will keep it there rather than being replaced when the itemArray gets an Array. Please read carefully GoJS Item Arrays-- Northwoods Software