Hadith.1218 - Al-Hasan ibn Mahbub narrated from Jamil ibn Salih, from Sama’a, from Imam Jafar ibn Muhammad Al-Sadiq (as) regarding a man who was behind the Imam and missed one rak'ah, but then the Imam mistakenly performed five rak'ahs.
Imam (as) said
"He (the follower) should make up the missed rak'ah and should not count the Imam's mistake”.