What determines which side of a triangle is visible (in your case pink), is the orientation of its vertex indices. The way it works is that if they are arranged in a clockwise direction then the triangle is forward-facing and visible. By contrast, a counter-clockwise direction means that the triangle is not rendered and not visible. So, it seems that part of your triangles have clockwise-arranged vertex indices and the other one have counterclockwise-arranged vertex indices. So, create new gameobject, reset its position, add meshfilter, put the script on it, read my comments in the script and play with it by uncommenting and commenting. Here’s the code:
private void OnValidate()
{
MeshFilter mf = gameObject.GetComponent<MeshFilter>();
Vector3[] vertices = new Vector3[]
{
new Vector3(-1f, 1f, 0), // index 0 in triangles array
new Vector3(1f, 1f, 0), // index 1 in triangles array
new Vector3(1f, -1f, 0), // index 2 in triangles array
new Vector3(-1f, -1f, 0) // index 3 in triangles array
};
int[] triangles = new int[]
{
// Let's assume that you are forward-facing. In other words, looking at the Z axis direction.
// Those indices are arranged clockwise so you will see the triangles
//0, 1, 2,
//2, 3, 0
// You will also see these triangles
//1, 2, 0,
//3, 0, 2
// And these too. There can be many combinations as you can see:
//2, 0, 1,
//0, 2, 3
// But you won't see them when you arrange them counterclockwise (they are seen from behind), like that:
//0, 2, 1,
//0, 3, 2
// Or like that. There can be many combinations:
//1, 0, 2,
//0, 3, 2
// Your problem, however, is that one triangle has its indices clockwise arranged, and the other one counterclockwise. They just look like that:
0, 1, 2,
2, 0, 3
// Of course, in your case, there can be many combinations. It can be also like that:
//1, 2, 0,
//0, 3, 2
};
Mesh mesh = new Mesh();
mesh.vertices = vertices;
mesh.triangles = triangles;
mf.mesh = mesh;
}