Thanks for the Sandcastle example!
It looks like the disappearing parts are fixed by setting clampToGround: true on the polyline.
Another thing you could do is disable depth test on that one individual polyline. You can effectively do this by using a depthFailMaterial that has the same material as the regular polyline. One more way to fix it is to give the polyline points a height a little above the ground (about 1000 seemed to work well in this demo).
Thanks again for reporting this.