Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:8:34

But why should Allah not punish them while they obstruct ˹people˺ from al-Masjid al- Haram and they were not ˹fit to be˺ its guardians? Its ˹true˺ guardians are not but the righteous, but most of them do not know.  

But what ˹plea˺ have they now, that God should not chastise them, with the sword, after your departure and that of the oppressed ˹believers˺ — if this ˹verse˺ is understood in accordance with the first opinion ˹that it refers to the idolaters asking forgiveness˺, then it abrogates the previous one, for God had chastised them at Badr and in other instances — when they bar, prevent the Prophet (s) and the Muslims, from the Sacred Mosque, ˹from˺ performing circumambulations there, though they are not its guardians?, as they claim? Its only ˹rightful˺ guardians are the God-fearing, but most of them do not know, that they have no ˹rightful˺ custodianship over it.
القرآن:٨:٣٤

وَمَا لَهُمْ أَلَّا يُعَذِّبَهُمُ اللَّهُ وَهُمْ يَصُدُّونَ عَنِ الْمَسْجِدِ الْحَرَامِ وَمَا كَانُوا أَوْلِيَاءَهُ ۚ إِنْ أَوْلِيَاؤُهُ إِلَّا الْمُتَّقُونَ وَلَٰكِنَّ أَكْثَرَهُمْ لَا يَعْلَمُونَ  

{ومالهم أ} ن {لا يعذبهم الله} بالسيف بعد خروجك والمستضعفين وعلى القول الأول هي ناسخة لما قبلها وقد عذَّبهم الله ببدر وغيره {وهم يصدُّون} يمنعون النبي ﷺ والمسلمين {عن المسجد الحرام} أن يطوفوا به {وما كانوا أولياءه} كما زعموا {إن} ما {أولياؤه إلا المتقون ولكن أكثرهم لا يعلمون} أن لا ولاية لهم عليه.