Join and trim curves

Hi Solamour. Apologies for the delay, I was caught at work, I am only looking back into this now.
I have checked the post you shared, I appreciate. I think the answer is there, but it is resisting. I downloaded the dyn that Vikram shared:

, but I am getting some warnings to do with multiple definitions for "List’ I believe it is related to the fact that I have Orchid installed.

Anyway, I have created a simplified version of both the dyn I am working on as well as the Revit file, I will keep working on this, and I will post them here in case someone has time to experiment too.
WALL CURVE TRIM.dyn (112.1 KB)
M_03_reduced.rvt (904 KB)
The thing is that once i created the simplified version of the Revit file, I don’t get the output that I believed caused your proposal to extend the start and end by half the thickness of the core layer, I only get the walls not being joined (depending on the margin parameter used) or I get them trimmed and joined in the wrong order at the bump out:

case 1: (margin 1)

case 2: (margin 7)

and those are the outputs, it seems like now, even if the margin is 100 it does not make any difference, as it did before:

The dyn I have uploaded does not contain Vikram’s code, I am now going to try to add it.

Thank you