So first thing first, getting curves of multi segment grids need a special method, first getting the grid-ID an then calling that element by ID. This will “split up” the multi grid in single grids and you can get the curve from them.
x = UnwrapElement(IN[0]) ids = x.GetGridIds() grids = [] for i in ids: grids.append(doc.GetElement(i)) OUT = grids
For more info see this post by @Konrad_K_Sobon: