The draw order for segments of trail is based on an incorrect depth calculation. Parts of the trail that are newer are always the ones drawn on top.
As you can see in the video, the parts of the trail with more depth are being drawn on the top instead of at the back, making the trail look very strange.
Expected behavior
Instead, the parts of the trail closest to the camera should be what is drawn on the top.