السؤال: يقول أنّه صلى في مسجد الحُسين وفيه قبر وهو جاهل بالحكم فماذا عليه ؟
الجواب: على كلّ حال الصلاة في المساجد التي فيها قبور باطلة ,والمسجد والقبر لا يجتمعان في الإسلام ,فأرى من الأحوط له أن يقضي هذه الصلاة
Shaykh Rabī' ibn Hādī al-Madkhalī Regarding One Who Prayed in Mosque That Has a Grave in It While He Was Ignorant of the Ruling
Question: He says that he prayed in the mosque of Al-Husayn while there is a grave in it, and he is unaware of the religious verdict upon it [of it being prohibited to pray in mosques that have graves in them]. Therefore what is upon him?
Answer: In every circumstance; the prayer in mosques that have graves inside them is invalid and the mosque and the grave are not combined in Islām. I hold that it is from the most correct [of matters] for him to make up this prayer.
Source: http://www.rabee.net/ar/articles.php?cat=11&id=272
https://wp.me/p8bMDj-5B