Arguably, Rome itself is such an example. Over the course of its long history it was repeatedly pushed to the brink of ruin only to slowly build back up without ever quite reaching its old heights.
The crisis of the third century could easily have been the doom of Rome, with its crumbling splinter states infighting until they broke apart completely. Instead, the succession of Aurelian, Diocletian, and Constantine were able to build it back into a single unified state, if not so prosperous or dominant as the previous version had been.
The same chaos that took the west might well have claimed the east as well under different circumstances, but over time they were able to restabilize, recover, and start to grow again. If not for the Justinian Plague, the reconquest of Italy might have been an actual success instead of the phyrric one it turned into. If nothing else, they at least managed to hold onto fully half the empire until centuries later when the Arabic conquests began.
And speaking of those early conquests, there was absolutely no guarantee that those wars were something they would survive. The Empire was still recovering from a brutal, generations long war against Persia, which itself did not survive as an independent state. The sieges of Constantinople were harsh and brutal, and could have gone differently, but they held on and slowly regained control of what they could, until the Macedonian dynasty was at least the foremost power in the region once again.
But then they screwed it up, spent some years in decline from a succession of bad rulers culminating in a few key defeats to the Turkish invaders caused in large part by infighting from wealthy elites. After this, they spent most of a generation with various elites selling off bits of the remaining empire to secure a throne whose value continued dropping with each betrayal. This too could easily have been the end, but eventually things stabilized. One of these grasping leaders actually managed to hold onto power and slowly rebuild. Then one lucky crusade later, they actually have much of their pre-Turkish territory back.
Except oops, a grasping member of the imperial family seizes control and drives it into the ground. After that we get a succession of weak emperors unable to deal with the harsh realities of their situation, followed by a series of coups that results in one of the displaced heirs inviting the fourth crusade into empire, which eventually results in the capital being sacked and the empire shattering into tiny city states.
That really ought to have been the end. Except that one of these states managed to regain control, rebuild to a fraction of their old strength, and at least hold most of Greece and Western Anatolia. It was a tiny, tiny fraction of the pre-crusade empire, much less Rome at its height, but they were still able to carve another century or two of stability when all hope had seemed lost.