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:17:37

And do not walk upon the earth exultantly. Indeed, you will never tear the earth ˹apart˺, and you will never reach the mountains in height.  

And do not walk in the earth exultantly, that is, exultant with pride and conceit. Indeed you will not rend the earth, ˹you will not˺ pierce it and reach its depths with your pride, nor attain the mountains in height: the meaning is that you shall never attain such ends, so how can you be so arrogant?
القرآن:١٧:٣٧

وَلَا تَمْشِ فِي الْأَرْضِ مَرَحًا ۖ إِنَّكَ لَنْ تَخْرِقَ الْأَرْضَ وَلَنْ تَبْلُغَ الْجِبَالَ طُولًا  

{ولا تمش في الأرض مرحا} أي ذا مرح بالكبر والخيلاء {إنك لن تخرق الأرض} تثقبها حتى تبلغ آخرها بكبرك {ولن تبلغ الجبال طولاً} المعنى أنك لا تبلغ هذا المبلغ فكيف تختال.