Invalid Curve

I am trying to move the start of a curve to a perpindicular distance x away from the original point, however, line 22 seems to work perfectly on the other hand line 23 produces an invalid curve, any help on how to fix this?

Best hopes,

Screenshot is too small. Always upload files.