This is probably an issue with the orientation of the base of the tetra.
Try to swap index 1 and index 2 of the points:
tetra.GetPointIds().SetId(0, 4)
tetra.GetPointIds().SetId(1, 6) // <--
tetra.GetPointIds().SetId(2, 5) // <--
tetra.GetPointIds().SetId(3, 7)