NGons and UnifyNormals

If I have a simple hex extruded box, with each face as ngon.

When I call function mesh.UnifyNormals()

the order of ngons vertex list changes.
I believe it becomes reversed.
And it happens for some of the boxes while other order stays the same.

Why this happens?
What is behind unifynormals function?

More hexes boxes here, it is just one hexagon extracted.
Is it possible to force ngons vertexList order make the same after unifynormals functions?

One idea that comes into mind is to check ordering before and after unifynormals, and if they do not match reverse ngons order

This one helped:

public static void UnifyNormalsNGons(this Mesh mesh) {

    uint[][] boundaries = mesh.GetNGonsBoundaries();
    uint[][] boundaries2 = mesh.GetNGonsBoundaries();

    uint a, b;

    for (int i = 0; i < boundaries.Length; i++) {
        a = boundaries[i][1];
        b = boundaries2[i][1];

        if (a != b) {
            List<int> castBoundaries = boundaries[i].ToList().ConvertAll(x => (int)x);
            List<int> castFaces = mesh.Ngons[i].FaceIndexList().ToList().ConvertAll(x => (int)x);
            mesh.Ngons[i] = Rhino.Geometry.MeshNgon.Create(castBoundaries, castFaces);


Mesh.UnifyNormals does re-order face vertex indices if needed. However, the function does nothing with respect to ngons.

– Dale