Ravan was fully confident that Shri Ram will not be able to even find Lanka let alone defeat him then one day a Vaanar comes and kills his youngest son. Throughout the war he had to see his kingdom gets destroyed and sons die.
In Sarga 59 of Yuddha kand, he is defeated and humiliated by Shri Ram and spared.
**तं निर्विषाशीविषसंनिकाशं |
शान्तार्चिषं सूर्यमिवाप्रकाशम् |
गतश्रियं कृत्तकिरीटकूट |
मुवाच रामो युधि राक्षसेन्द्रम् ||** ६-५९-१४१
Translation: In that battle-field, Rama said to that Lord of Demons whose splendour was dimmed, the setting of his diadem river, who resembled a venomous snake robbed of its poison or like a sun its rays extinguished, bereft of lustre.
कृतं त्वया कर्म महत्सुभीमं |
हतप्रवीरश्च कृतस्त्वयाहम् |
तस्मात्परिश्रान्त इति व्यवस्य |
न्न त्वां शरैर्मऋत्युवशम् नयामि || ६-५९-१४२
Translation: You have accomplished a highly terrific great feat and my brave soldiers have succumbed beneath your blows. Now, you are weary and in this condition, I shall not put you under the clutches of Death.
तं निर्विषाशीविषसंनिकाशं | शान्तार्चिषं सूर्यमिवाप्रकाशम् |
गतश्रियं कृत्तकिरीटकूट | मुवाच रामो युधि राक्षसेन्द्रम् || ६-५९-१४१
स एवमुक्तो हतदर्पहर्षो |
In that battle-field, Rama said to that Lord of Demons whose splendour was dimmed, the setting of his diadem river, who resembled a venomous snake robbed of its poison or like a sun its rays extinguished, bereft of lustre.
निकृत्तचापः स हताश्वसूतः |
कृतं त्वया कर्म महत्सुभीमं | हतप्रवीरश्च कृतस्त्वयाहम् |
तस्मात्परिश्रान्त इति व्यवस्य | न्न त्वां शरैर्मऋत्युवशम् नयामि || ६-५९-१४२
शरार्दितो भग्नमहाकिरीटो |
You have accomplished a highly terrific great feat and my brave soldiers have succumbed beneath your blows. Now, you are weary and in this condition, I shall not put you under the clutches of Death.
विवेश लङ्काम् सहसा स्म राजा ||
स एवमुक्तो हतदर्पहर्षो | निकृत्तचापः स हताश्वसूतः |
शरार्दितो भग्नमहाकिरीटो | विवेश लङ्काम् सहसा स्म राजा ||
Translation: At these words, that King Ravana, his joy boasting subdued, his bow shattered, his horses and chariot slain pierced with arrows, his great diadem broken, he soon returned to Lanka.
At these words, that King Ravana, his joy boasting subdued, his bow shattered, his horses and chariot slain pierced with arrows, his great diadem broken, he soon returned to Lanka.
This is before Indrajeet and Kumbakaran even came on battlefield. If Rama had killed him swiftly then he would have spared lot of emotional pain of death of his sons and brother. At the end, he is left all alone before final Ram-Ravan yuddh.
Source: https://www.valmikiramayan.net/utf8/yuddha/sarga59/yuddha_59_frame.htm