This is a controversial issue among Muslim Jurists for which we would like to cite the following summarized response given by Sheikh Ahmad Kutty. He said:

“This is an issue which is contentious among scholars. However, we have authentic traditions from the Prophet, peace be upon him, that he allowed Mu’adh to lead salah after he had prayed behind him in his mosque; so, for him, it was a nafl, but for those praying behind him, it was a fard.

Based on this precedent, many scholars are of the view that it can be done. Where there is a well attested hadith, we need not stick rigidly to fiqh rulings that contradict it.

There is also precedent from the Prophet for someone praying in Jama`ah after he had prayed at home; so while it was fard for the imam, it was nafl for the one who prayed behind him the same salah for the second time.”