Similarly, al-Suyuti records in al-Jamiʿ the report transmitted by al-Hakim in al-Kuna, traced back to ʿAʾisha, in which the Prophet said: “The grave of Ishmael is inside the Ḥijr (the semi-circular enclosure adjacent to the Kaʿba).”
The second point is that the graves whose existence within al-Masjid al-Ḥaram is alleged are neither visible nor raised. Because of that, no one seeks them out for devotion apart from Allah, and their presence deep beneath the mosque’s floor causes no harm. These narrations, therefore, cannot be taken as proof that it is permissible to build mosques atop elevated graves that stand above ground, for the difference between the two situations is manifest.
This is the very answer given by Shaykh ʿAli al-Qari, may Allah have mercy on him. In Mirqat al-Mafatih (1/456), after citing the statement of the exegete I mentioned in the annotation, he wrote:
“Another scholar has said that the outline of Ishmael’s grave, upon him be peace, is in the Ḥijr beneath the waterspout, and that in the Ḥatim—between the Black Stone and the Well of Zamzam—there lies the grave of seventy prophets.” Al-Qari then commented: