Creative Tension between Justice and Mercy

To bring Absalom to David’s court after his banishment, Joab the commander used a parable that was spoken by an old widow. She comes to the court of David and states she is a widow. She had two sons, both fought, and one was killed. Now, the villagers demand that the murderer should be punished by death sentence. The widow pleads for mercy to save his son who is alive. (I Samuel 14: 5-7) According to the Law, her son who is alive should die. Now, King David overrules the Law, by showing mercy that the murderer will live and will not be punished.
Was justice denied to the dead person? By letting the murderer scot-free, was Law violated? How can King David violate the Law to show mercy? Did David have any basis to forgive the murderer?
David showed mercy that may not be strictly legitimate. As a King he had authority to issue such an order, but it violated the Law of God. In fact, David could only grant reprieve or suspend the death sentence but could not give forgiveness.
God cannot offer forgiveness, without legal basis. “We must all die; we are like water spilled on the ground, which cannot be gathered up again. But God will not take away life, and he devises means so that the banished one will not remain an outcast.” (II Samuel 14:14) Hence, Lord Jesus came into this world, to die on the cross of Calvary to bear the punishment of sin, which is death. (Romans 6:23) Lord Jesus was buried and rose again. Hence, forgiveness is offered to sinful humans. Therefore, Apostle John states that God is faithful and just to forgive our sins. (I John 1:9)
Even when God shows mercy that fulfils righteousness, it is termed as grace. Holy God cannot let sinners go scot-free without punishment. God is faithful, not to punish sinners again as Lord Jesus took that punishment. Hence, grace and truth were combined in Lord Jesus. (John 1: 14) In faith, people can receive this great salvation.
Have I received His gracious forgiveness?