Praise be to Allah.
This hadeeth was narrated by Ibn Majah in his Sunan (4039).
Almost all the muhadditheen (hadeeth scholars) are agreed that this hadeeth is da’eef (weak).”
It was classed as da’eef by al-Bayhaqi, al-Hakim, Shaykh al-Islam Ibn Taymiyah in Manhaj al-Sunnah (8/256), and Ibn al-Qayyim in al-Manar al-Muneef (p.148).
Al-Thahabi said in Meezan al-I’tidal (3/535): it is a munkar (rejected) report.
Al-Qari said in Mirqat al-Mafateeh (10/183): it is da’eef according to the consensus of the muhadditheen.
It was mentioned by al-Shawkani in al-Qawaa’id al-Majmoo’ah, 127. He said: al-San’ani said: (it is) mawdoo’ (fabricated).
Al-Albani said in Silsilat al-Ahadeeth al-Da’eefah (77): It is munkar.
Even if this hadeeth were saheeh – but it is not saheeh – the meaning would be that there is no one who is perfectly guided (mahdi) or protected from sin and error except ‘Eesa ibn Maryam (peace be upon him). This was stated by al-Qurtubi, Ibn al-Qayyim and Ibn Katheer.
This does not contradict the fact that the Mahdi will emerge at the end of time and that he will join forces with ‘Eesa ibn Maryam (peace be upon him), and ‘Eesa will pray behind him in congregation.
We have already stated in the answer to question no. 1252 the evidence showing that the Mahdi will emerge at the end of time with the attributes that the Prophet (peace and blessings of Allah be upon him) described. These saheeh ahadeeth (authentic narrations) cannot be contradicted by a da’eef hadeeth like this one.
See al-Ahadeeth al-Da’eefah, 1/89 by al-Albani. Al-Mawsoo’ah fi Ahadeeth al-Mahdi al-Da’eefah wa’l-Mawdoo’ah by al-Bastawi, p. 94-104.