I was with Messenger of Allah ﷺ (on the occasion) of 'Id al-Adha. After he had completed the prayer with people, he found that the goats had been slaughtered, whereupon he said: He who slaughtered sacrificial animal before the prayer should slaughter a goat (again) in its stead and he who has not slaughtered he should slaughter it by reciting the name of Allah. (Using translation from Muslim 1960b)
شَهِدْتُ الْأَضْحَى مَعَ رَسُولِ اللهِ ﷺ فَصَلَّى بِالنَّاسِ فَلَمَّا قَضَى الصَّلَاةَ رَأَى غَنَمًا قَدْ ذُبِحَتْ قَالَ «مَنْ ذَبَحَ قَبْلَ الصَّلَاةِ فَلْيَذْبَحْ شَاةً مَكَانَهَا وَمَنْ لَمْ يَكُنْ ذَبَحَ فَلْيَذْبَحْ عَلَى اسْمِ اللهِ»