Plane on curve

Hi.
I always ending in to this problem:

Why my planes oriented by the tangent in a curve have the X and Y axes that they change each other sometime in many points?

How can I resolve this problem that follow me since a few years?

PLANE ON SPLINE.3dm (794.8 KB)
PLANE ON SPLINE.gh (5.7 KB)

Hi Merlin,
I’m not sure if this is the solution you are looking for, but anyways:

I am sure you can find stuff about tangency of splines if you are interested in that.

.Eero

You could also try Align Plane using the Z axis.

PLANE ON SPLINE_1.3dm (56.7 KB)
PLANE ON SPLINE_1.gh (9.3 KB)

maybe like this?