New group from list

Hi.
Help Wanted.
I need to convert the list on the left to the list on the right.
Already broke my head.
image

Does this work for you?

Thank you, but no.
I need the Pipe in “0 List” and Pipe in “1 List” be together, because in “0 List” and “1 List”, the 1 element is the same, Pipe in “2 List” and Pipe in “3 List” be together, because in “2 List” and “3 List”, the 1 element is the same.

Try this in a code block

TrnLst =
List.Transpose(lst);
//Shifts the list so you have all the 1 and 2 elements in one list and all the 'pipe' elements in another.

GroupedPipes=
List.FirstItem(List.GroupByKey(TrnLst[0],TrnLst[1].Id));
//groups each pipe by the Element Id for the 1 and 2 elements and, discards the 1 and 2 Element Ids.