Praise be to Allah, and peace and blessings upon our master, the Messenger of Allah.
If a defect that invalidates the sacrifice (uḍḥiyah) arises after its purchase — for example, if one purchased a sound, defect-free animal, and it then developed a limp, blindness in one eye, or a similar defect before slaughter — it does not fulfill the requirement of a valid uḍḥiyah, according to the Shāfi'ī school.
It is stated in Asnā al-Maṭālib fī Sharḥ Rawḍ al-Ṭālib (Vol.1/P.535): "Even if the limp develops [in the animal] while the knife is upon it, it still does not fulfill the requirement, because it is lame at the moment of slaughter — this is analogous to a case where a sheep's leg breaks and one hastens to slaughter it [in that condition]."
The Ḥanbalī school, however, held that if the one offering the sacrifice purchased the animal while it was sound and defect-free, and a defect then befell it afterward, the sacrifice remains valid and there is no obligation to replace it.
It is stated in Masā'il al-Imām Aḥmad, one of the Ḥanbalī reference works (Vol.8/P.4021): "I said: If a person purchases the sacrificial animal while it is sound, and it is then afflicted with illness, blindness in one eye, or a broken limb [before slaughter]? He [Imam Aḥmad] said: It is said that it still fulfills the requirement. Isḥāq said likewise, because he purchased it while sound, and the defect befell it only afterward, so it remains sufficient on his behalf." [End of quote]
Accordingly, a sheep afflicted with a defect that invalidates the sacrifice does not fulfill the requirement of a valid uḍḥiyah — whether the defect arose after purchase or during the slaughter itself — according to the Shāfi'ī school. However, there is no objection to following the Ḥanbalī position on this matter [as a valid alternative]. And Allah, the Most High, knows best.