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:3:147

And their words were not but that they said, "Our Lord, forgive us our sins and the excess ˹committed˺ in our affairs and plant firmly our feet and give us victory over the disbelieving people."  

All that they said, when their prophet had been killed while they stood their ground and were steadfast, was, ‘Our Lord, forgive us our sins and our excesses, our overstepping the bounds, in our affairs, a declaration of the fact that what had befallen them was the result of their evil actions and a humbling of their selves, and make firm our feet, with strength for the struggle, and help us against the unbelieving folk’.
القرآن:٣:١٤٧

وَمَا كَانَ قَوْلَهُمْ إِلَّا أَنْ قَالُوا رَبَّنَا اغْفِرْ لَنَا ذُنُوبَنَا وَإِسْرَافَنَا فِي أَمْرِنَا وَثَبِّتْ أَقْدَامَنَا وَانْصُرْنَا عَلَى الْقَوْمِ الْكَافِرِينَ  

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