Anas bin Malik reported,

The Prophet ﷺ said, "Whoever slaughters before the prayer must repeat the sacrifice."A man said, "This is a day on which meat is desired," and he mentioned the difficult circumstances of some of his neighbors. The Prophet ﷺ seemed to accept his excuse. The man then said, "I have a young goat that is better to me than two sheep."The Prophet ﷺ granted him permission, but I do not know whether the permission extended beyond him or not. Then the Prophet ﷺ turned to two rams and slaughtered them, and the people turned to a small flock of sheep and slaughtered them.

Bukhari 5561

Sahih

حدثنا علي بن عبد الله حدثنا إسماعيل بن إبراهيم عن أيوب عن محمد

عن أنس

عن النبي ﷺ قال من ذبح قبل الصلاة فليعد فقال رجل هذا يوم يشتهى فيه اللحم وذكر هنة من جيرانه فكأن النبي ﷺ عذره وعندي جذعة خير من شاتين فرخص له النبي ﷺ فلا أدري بلغت الرخصة أم لا ثم انكفأ إلى كبشين يعني فذبحهما ثم انكفأ الناس إلى غنيمة فذبحوها

البخاري 5561صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Sacrificial animals
Chapter
Whoever slaughtered before the prayer must repeat it
Numbering
Darussalam 5561
Bukhari 5561