That sounds like you may be passing a dynamo curve instead of a Revit API curve. Please check the following post and see if it fixes your problem;