Multiple Corridor Creation vs Single

I am working on a new Dynamo graph that started out as a single use case graph where it would take a single polyline and create an alignment, corridor, surface, etc. and it was working great. The next logical step for me was to make it so it would work on multiple polylines for different areas to make their own unique alignment, corridor, etc. When I run the same script on multiple polylines it will just crash C3D/Dynamo without seemingly much answer as to where it is breaking. I have identified a couple key spots I will detail out below and found, however, that if you slowly work the script by freezing and unfreezing nodes it will run successfully for the script in that fashion as I would expect. Those key nodes are in order below:

  1. Corridor.ByName
  2. Corridor.AddBaselineByAlignmentProfile
  3. Baseline.AddRegion (first region to add for each corridor)
  4. Baseline.AddRegion (second and final region to add for each corridor)
  5. BaselineRegion.SetHorizontalBaselineFrequency
  6. Corridor.AddCorridorSurface

If I slowly work through freezing and unfreezing each node and running the script at each step it will work for multiple polylines at the end. Does anyone have any ideas or experience with how to make this work in a single run?

I am attaching the .dyn file for anyone who might have time to look into it.

Thanks!

03_Basin Corridor Creation.dyn (469.5 KB)