Yazid al-Aswad says: “We prayed dawn prayer (fajr) with the Messenger of Allah at Mina and two men came and stopped at their resting places. The prophet ordered for them to be brought and they came shaking with fear. The Prophet said to them: ‘What prevented you from praying with the people? …Are you two not Muslims?’ They answered: ‘Certainly we are, O Messenger of Allah, but we had prayed in our resting place.’ The Prophet told them: ‘If you pray in your resting places and then come upon an imam, pray with him, and it will be nafl for you.'” This is related by Ahmad and Abu Dawud. An-Nasa’i and at-Tirmizhi record it in these words: “lf you pray in your resting places and then you come to a mosque with a congregation, pray with them, and it will be nafl for you.” At-Tirmizhi calls it hasan sahih and Ibn as-Sakin says it is sahih.
This hadith shows that it is correct for one to repeat a salah as a nafl with a congregation even if he has already performed it, individually or with a congregation.
It is related that Huzhaifah repeated the zuhr, ‘asr, and maghrih prayers although he had prayed them in congregation. It is also related that Anas prayed fajr behind Abu Musa at the place where fruits are dried and then he went to the congregational mosque and repeated the salah behind alMughirah ibn Shu’bah. Nevertheless, this action contradicts authentic hadith of the Prophet sallallahu alehi wasallam in which he reportedly said: “Do not pray the same salah twice in one day.” The apparent conflict has been resolved by Ibn ‘Abdul-Barr who writes, “Ahmad and Ishaq agree that this refers to praying an obligatory salah and then, after a while, repeating it as the obligatory prayer. Now, as for the one who repeats the salah with a congregation with the intention that the second prayer is not a repeat of the obligatory salah but that it is simply a voluntary prayer, he obeys the Prophet’s order of not making the same salah twice, as the first salah was obligatory and the second was nafl; hence, there is no repetition.”