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:22:44

And the inhabitants of Madyan. And Moses was denied, so I prolonged enjoyment for the disbelievers; then I seized them, and how ˹terrible˺ was My reproach.  

and the inhabitants of Midian, the people of Shu‘ayb, and Moses was also denied: he was denied by the ˹native˺ Egyptians (al-qibt), and not by his people, the Children of Israel. In other words, ˹all of˺ those ˹people˺ denied their messengers, so take them ˹these messengers˺ as a good example ˹of constancy˺. And I granted the disbelievers respite, I postponed ˹dealing with˺ them by deferring their requital, then I seized them, with chastisement, and how ˹terrible˺ was My abhorrence! (nakīr), that is to say, My rebuke (inkār) of them for their denial, by My destroying them (the interrogative is meant as an affirmative, in other words,: it ˹My chastisement˺ was well-placed).
القرآن:٢٢:٤٤

وَأَصْحَابُ مَدْيَنَ ۖ وَكُذِّبَ مُوسَىٰ فَأَمْلَيْتُ لِلْكَافِرِينَ ثُمَّ أَخَذْتُهُمْ ۖ فَكَيْفَ كَانَ نَكِيرِ  

{وأصحاب مدين} قوم شعيب {وكُذب موسى} كذبه القبط لا قومه بنو إسرائيل أي كذب هؤلاء رسلهم فلك أسوة بهم {فأمليتُ للكافرين} أمهلتهم بتأخير العقاب لهم {ثم أخذتهم} بالعذاب {فكيف كان نكير} أي إنكاري عليم بتكذيبهم بإهلاكهم والاستفهام للتقرير: أي هو واقع موقعه.