The Prophet ﷺ said, "Whoever slaughtered the sacrifice before the ʿId prayer, should repeat it (slaughter another one)." A man said "This is the day on which meat is desired." Then he mentioned the need of his neighbors (for meat) and the Prophet ﷺ seemed to accept his excuse. The man said, "I have a Jadha'a which is to me better than two sheep." The Prophet ﷺ allowed him (to slaughter it as a sacrifice). But I do not know whether this permission was general for all Muslims or not. The Prophet ﷺ then went towards two rams and slaughtered them, and the people went towards their sheep and slaughtered them.
عَنِ النَّبِيِّ ﷺ قَالَ مَنْ ذَبَحَ قَبْلَ الصَّلاَةِ فَلْيُعِدْ فَقَالَ رَجُلٌ هَذَا يَوْمٌ يُشْتَهَى فِيهِ اللَّحْمُ وَذَكَرَ مِنْ جِيرَانِهِ فَكَأَنَّ النَّبِيَّ ﷺ عَذَرَهُ وَعِنْدِي جَذَعَةٌ خَيْرٌ مِنْ شَاتَيْنِ فَرَخَّصَ لَهُ النَّبِيُّ ﷺ فَلاَ أَدْرِي بَلَغَتِ الرُّخْصَةُ أَمْ لاَ ثُمَّ انْكَفَأَ إِلَى كَبْشَيْنِ يَعْنِي فَذَبَحَهُمَا ثُمَّ انْكَفَأَ النَّاسُ إِلَى غُنَيْمَةٍ فَذَبَحُوهَا