Model curves (part.Curves.CreateLine) are SmartObjects that can't be added to a sketch via AddGeometry. Switch to SketchLineBuilder which creates native sketch geometry directly (SetStartPoint/SetEndPoint/Commit).