Reference: Fataawa wa Rasaa.il Shaykh ‘Abdur-Razzaaq ‘Afeefee – Volume 1, Page 165, Fatwa No.46
Question: What is the ruling regarding a man who has been buried in the masjid?
Response: So long as he has been buried in the masjid after it was built, it is obligatory to remove the buried [person] from the masjid, even if he be [reduced to] bones.