There are two separate matters here:
- Proverbs repeatedly discourages surety for financial debts. The same book also repeatedly discourages debt itself.
- By contrast, Jesus was surety for our debt of sin - which we had no hope of ever paying, thus, Jesus decided to take responsibility for our debt of sin.
Note that financial debt is entered into at the request of the borrower; by contrast, the debt of sin is something that all sinners (Rom (3:10-18, 23, 24) are born with and thus have no choice and no hope of repaying the debt. Put another way, Jesus become the "Redeemer" - the one who pays the manumission fee or ransom fee, to free us from the slavery of sin (Luke 1:68, 24:21, Matt 20:28, Mark 10:45, 1 Tim 2:6, Heb 9:15, 1 Cor 6:20, 7:23, Gal 3:13, 4:5, Titus 2:14, 1 Peter 1:18, Rev 5:9).
Thus, Jesus steps in to repay the debt. We see the latter numerous times and is generally known by the title of the great Divine Exchange:
- 2 Cor 5:21, God made him who had no sin to be sin for us, so that in him we might become the righteousness of God.
- Gal 1:4, who gave himself for our sins to rescue us from the present evil age, according to the will of our God and Father.
- Gal 3:13, Christ redeemed us from the curse of the law by becoming a curse for us. For it is written: “Cursed is everyone who is hung on a tree.
- John 3:16, For God so loved the world that He gave His one and only Son, that everyone who believes in Him shall not perish but have eternal life.
- 2 Cor 8:9, For you know the grace of our Lord Jesus Christ, that though He was rich, yet for your sakes He became poor, so that you through His poverty might become rich.
- 1 Peter 3:18, For Christ also suffered for sins once for all, the righteous for the unrighteous, to bring you to God. He was put to death in the body but made alive in the Spirit,
- Isa 53:4-6, Surely He took on our infirmities and carried our sorrows; yet we considered Him stricken by God, struck down and afflicted. But He was pierced for our transgressions, He was crushed for our iniquities; the punishment that brought us peace was upon Him, and by His stripes we are healed. We all, like sheep, have gone astray, each of us has turned to our own way; and the LORD has laid on him the iniquity of us all.
That is, Jesus was treated as we deserve so that we might be treated as He deserves.
Thus, Jesus' atonement for our sin is often called a free gift, and the initiative of God. Rom 4:4, 5:15-17, 6:23, 2 Cor 9:14, 15, Eph 2:8, 3:7, Heb 6:4. See also Rom 3:20-24.