Join and trim curves

Hi Mark. Thank you for your response. Everything helps.
Unfortunately I can only share some details, but I will try to illustrate the situation.

The lines you see are not wall location lines. They are location lines offset half the thickness of the core layer, in other words, I am aiming at the outside face of studs in order to provide a diagrammatic Drafting View that is easy to dimension. I work at a modular construction company, so what you see there are actual modules, which is why geometry comes grouped and the list structure is the one it is, I need to keep that structure in order to tell what “box” things are related to.

I don’t know what exact wall you are referring to, but all walls needed are already fetched since the selection responds to a filter by type mark.

In answer to your suggestion, extending lines by thickness, I don’t think that would work, since it would always depend on how walls are joined in Revit, which I can’t depend on.

I have seen this node work perfectly in similar situations:
Curve Trim/Extend Problem - Revit - Dynamo (dynamobim.com)

I just don’t know why it wouldn’t do the magic here, so I am sure the node is working well, it’s something related to the order of curves on the sublist, just don’t know how to sort them, that’s my guess.

I will try to post a simplified version of the problem and a simplified version of the dyn.

Thanks again