This error can be thrown when adding certain boundaries to surfaces, and is caused by the polyline being used looping back on itself.
To fix this, there are two options:
OFFSET the polyline out, then back inwards by the same distance to return it to its original location. Offsetting the polyline like this should remove most self-intersections.