Spline component bug

Any idea how to fix this problem?

Simple spline component script made by this tutorial:UE4 Tutorial: Add spline-meshes procedurally - YouTube

After playing with some meshes this bug has occured:
Imgur

But it doesn´t do this bug always:
Imgur

Thank you