The curve operations require control points to determine the slope of the curve at the end points. The smooth curve operations produce a smooth join with the preceding curve by examining the preceding curve's control points and computing a smooth control point for the current curve. But your example never specifies any control points so this computation cannot be done. You need to either stick a CURVETO before the loop with a control point or have all of the CURVETOs in the loop also have control points.
Also, although I don't know what you are doing I suspect that you will be better off using CURVEREL instead of CURVETO.