His statement, “It is recommended that he repeat it, except Maghrib,” means that it is recommended for him to repeat the prayer that he performed first, except for Maghrib.
The evidence for this is the Prophet’s saying: “Perform the prayer at its appointed time. Then, if the prayer is commenced while you are in the mosque, pray, and do not say, ‘I have already prayed, so I will not pray.’” (1) That is, if you have performed the prayer at its appointed time, then it is commenced while you are in the mosque, pray, and do not say, “I have already prayed, so I will not pray.”
Another proof is that the Prophet ﷺ once prayed Fajr at Masjid al-Khayf in Mina. When he had finished his prayer, he noticed two men who had kept apart and had not prayed. He summoned them, and they were brought before him trembling with awe of the Messenger of Allah ﷺ. He said, “What prevented you from praying with us?” They said, “O Messenger of Allah, we had prayed at our lodgings.” He said, “If you have prayed at your lodgings and then come to a congregational mosque, pray with them, for it will be a voluntary prayer for you.” (2)
From this hadith, we learn that the second prayer is counted as a voluntary prayer, while the first prayer is the obligatory one. Accordingly, if a person prays in his own mosque and then comes to another mosque to attend a lesson, fulfil some need, or attend a funeral, and finds them praying, it is preferable for him to pray with them. His prayer with them will be voluntary, and the first prayer is the obligatory one. The second prayer cannot be the obligatory one, because the obligation was discharged by the first prayer; thus, it is the obligatory prayer, while the second is voluntary.
Issue: If he catches part of the repeated prayer, must he complete it, or may he conclude the prayer along with the imam?