Hadith 299B

قَالَ مَالِك : وَلَا أَرَى بَأْسًا أَنْ يُصَلِّيَ مَعَ الْإِمَامِ مَنْ كَانَ قَدْ صَلَّى فِي بَيْتِهِ إِلَّا صَلَاةَ الْمَغْرِبِ ، فَإِنَّهُ إِذَا أَعَادَهَا كَانَتْ شَفْعًا
Imam Malik, may Allah have mercy on him, said: If a person performs the prayer alone and then finds the prayer being performed with the Imam, there is no harm in performing it again, except for the Maghrib prayer, because if it is performed again, it will not remain odd, rather three will become two units.
Hadith Reference موطا امام مالك رواية يحييٰ / كتاب صلاة الجماعة / 299B
Hadith Takhrij «شركة الحروف نمبر: 281، فواد عبدالباقي نمبر: 8 - كِتَابُ صَلَاةِ الْجَمَاعَةِ-ح: 12»