What determines whether an animal that fails en route must be replaced?

Bab al-Hady — Sacrificial Offerings, Eligibility, Slaughter and Handling