We do not know the chain of transmission for that report, and in any case the very basis of the ḥadīth remains doubtful in view of the defect already mentioned. Allah knows best.
(All mosques are equal in this regard except the Sacred Mosque, for it is impermissible to allow them even to approach it, as Allah says: “O you who believe, the polytheists are indeed impure; so let them not approach the Sacred Mosque after this year of theirs” [9:28].)
This verse is proof that entry to the Sacred Mosque is forbidden to unbelievers and polytheists. Its wording, moreover, covers the entire ḥaram, and that is the view of ʿAṭāʾ ibn Abī Rabāḥ, who said: “The whole sanctuary is both qiblah and mosque; therefore they must be prevented from entering the ḥaram, in accordance with Allah’s words: ‘Glory be to Him who took His servant by night from the Sacred Mosque,’ even though the Prophet actually set out from the house of Umm Hānī.”
Al-Qurṭubī cited this and then added: “Accordingly, it is unlawful to permit a polytheist to enter any part of the ḥaram whatsoever. If an envoy from them comes, the ruler should go out to the area beyond the sanctuary to hear what he has to say.”
I say: The fact that the noble verse singles out the Sacred Mosque indicates that other mosques do not share its ruling, so polytheists may enter them; this is confirmed by the aforementioned ḥadīths. Ibn Ḥazm adopted this view in al-Muḥallā, saying: “It is permissible for polytheists to enter any mosque, with the sole exception of the entire sanctified precinct of Mecca—both the mosque proper and the surrounding area—for under no circumstances may a disbeliever enter it. This is also the position of al-Shāfiʿī and Abū Sulaymān. Abū Ḥanīfah, however, held that there is no objection to admitting a Jew or a Christian, while followers of the other religions are barred.”