Cannot manage why polyline primitives rotate/flip on mouse move, what's going on?

Dear Community,
Goal: define multiple polyline instances and add them to primitive.
Issue I am facing: Cannot get my head around the polyline that are plotted on the map but are weirdly rotating or flipping on mouse move. What’s going on?

Example:
Sandcastle cesium example polyline primitive

Appreciate if you could help me, thank you in advance!