A defect occurring after buying the animal?
If a defect occurs in the sacrificial animal after it has been bought, the sacrifice of such an animal is not permissible and it must be replaced, because being free of the legally recognised defects is a condition for the sacrifice. It is not a condition that the animal be free of defects at the time of buying; rather, the condition is that it be free of these defects at the time of slaughter, and slaughtering an animal afflicted with the aforementioned defects is prohibited.
Moreover, the narration from which it is understood that the sacrifice of an animal that becomes defective after being bought is permissible is a weak (da’if) narration.
Abu Sa’id al-Khudri (may Allah be pleased with him) narrates:
ابتعنا كبشا نضحي به، فأصاب الذئب من إليتيه وأذنه، فسألنا النبى صلى الله عليه وسلم فأمرنا أن نضحي به
“We bought a ram for sacrifice, and a wolf ate both of its buttocks and both of its ears. So we asked the Prophet ﷺ (about sacrificing it), and he ﷺ commanded us to slaughter this very ram.”