Why do I get a triangleIndex of -1 when I SphereCast a convex MeshCollider?

If I use Physics.SphereCastAll and it hits a MeshCollider that has it’s Convex property set, the resulting RayCastHit has a triangleIndex of -1.

If however, I use Physics.RayCast, then I get a valid triangle index for the same MeshCollider. Is this a bug, or is there a good reason for this?

The documentation says ‘Triangle index is only valid if the collider that was hit is a MeshCollider.’ - it doesn’t mention convex or concave colliders.

I’m just guessing, but it may happen whenever you hit one of the “fake” faces created to make the object convex.

The triangle index might be for the original mesh, so invalid for the new faces. Then the ray vs. sphere would be just a coincidence – the sphere just happened to hit an “added” face.