Solomon then took charge of the building. When it was finished he offered sacrifices, slaughtered the beasts, and gathered the Children of Israel. Allah, Exalted is He, revealed to him, “I see how delighted you are at the construction of My House; ask of Me and I shall grant you.” He said, “I ask You for three things: a judgment that accords with Your judgment; a kingdom that will belong to none after me; and that whoever comes to this House seeking only prayer will depart from his sins like the day his mother bore him.” The Messenger of Allah ﷺ said, “Two of them have already been granted, and I hope the third has likewise been granted.” End of quotation.
This report is cited in al-Majmaʿ (4/7–8) and al-Muntakhab (5/369). Al-Haythamī remarks, “Its chain contains Muḥammad ibn Ayyūb ibn Suwayd, who is accused of fabrication.”
I later found that al-Dhahabī also ruled the ḥadith fabricated, and he was correct. In his biography of Ibn Ayyūb he writes: “Al-Dāraqutnī declared him weak; Ibn Ḥibbān said, ‘It is not lawful to transmit from him’; Abū Zurʿah said, ‘I saw that he had inserted fabricated material into his father’s books.’ Among those forgeries, I say, is the ḥadith that states: ‘When David built the mosque it collapsed, and it was said to him, “You are not fit to oversee its construction.” He asked, “Why, my Lord?” Allah answered, “Because of the blood that was shed by your hand.” David said, “Was that not for Your pleasure?” Allah said, “Indeed, but they are My servants and I am most merciful to them …”’—and so forth in full.
I add: This narration was also transmitted by Ayyūb ibn Suwayd, the father of this Muḥammad, from Abū Zurʿah al-Shaybānī with the isnād cited earlier from Ibn ʿUmar, traced back to the Prophet, but without this reprehensible, fabricated addition. Ibn Mājah recorded it from ʿUbayd Allāh ibn al-Jahm al-Anmāṭī on his authority, and that is sufficient evidence.