In the case of David and Bath - sheba, before the judgment of the death penalty could be softened, there had to be a pardoning of their sin. The Israelite judges were not authorized to do this.
قَبْلَ تَخْفِيفِ حُكْمِ ٱلْإِعْدَامِ فِي حَالَةِ دَاوُدَ وَبَثْشَبَعَ ،‏ كَانَ يَجِبُ أَنْ يَغْفِرَ يَهْوَه لَهُمَا خَطِيَّتَهُمَا .‏