Mesh becomes invalid after Mesh.CombineIdentical in Rhino 6 C#

Hi everyone,
as the title says, after using the CombineIdentical method the mesh becomes invalid.
Does someone know why?
Here is my code:

  private void RunScript(List<Polyline> plines, ref object A)
  {

    var mm = new Mesh();
    for (int pl = 0; pl < plines.Count; pl++)
    {
      Line[] lines = plines[pl].GetSegments();
      Point3d center = plines[pl].CenterPoint();
      Mesh mesh = new Mesh();
      mesh.Vertices.Add(center);
      mesh.Vertices.AddVertices(plines[pl]);
      var faces = new List<int>();
      var vertices = new List<int>();
      for (int i = 0; i < lines.Length; i++)
      {

        mesh.Faces.AddFace(0, i + 1, i + 2);
        faces.Add(i);
        vertices.Add(i);

      }

      mesh.Ngons.AddNgon(MeshNgon.Create(faces, vertices));
      mm.Append(mesh);
    }
    CleanMesh(mm);
    A = mm;

  }

  // <Custom additional code> 
  public void CleanMesh(Mesh mesh)
  {

    mesh.Vertices.CombineIdentical(true, true);
    mesh.Vertices.CullUnused();
    mesh.Weld(Math.PI);
    mesh.FaceNormals.ComputeFaceNormals();
    mesh.Normals.ComputeNormals();

    if (mesh.SolidOrientation() == -1)
      mesh.Flip(true, true, true);

    mesh.Compact();
  }
  // </Custom additional code> 
}

File: 20201031_InvalidMesh.gh (4.9 KB)

Thanks for looking at it!
Have a nice weekend everybody!

See attached

20201031_InvalidMesh_Fixed.gh (6.1 KB)

Thanks Peter,

alwas nice to study your code.
On my machine it shows the same error message:

Well …

… either your Rhino build is bananas or this is a Karma related thingy.

Moral: life sucks

ok, in R5 both codes work, seems to be R6 related.

Mesh.gh (6.0 KB)

Thanks @Mahdiyar,

Also always nice to study your solutions.
My original data are not planar hexagons, so it seems using the AddPlanarNgons method is not the most suitable.