How to have a continuous ColorRamp in a broken spline (spline with removed segments)
The simplest solution is, don't delete spline segments.  If you want part of your spline to &quot;not exist&quot;, then use its UV to make these parts hidden, or use a mesh object with a curve modifier to create your spline:

Once you delete spline segments, Blender no longer has an understanding that the newly separated splines have any particular relationship to each other, and cannot draw a colorramp along their length.