Has this ever happened for an airliner?
* https://en.wikipedia.org/wiki/China_Airlines_Flight_611
This one only took 7 years from a bad repair until catastrophic failure though:
* https://en.wikipedia.org/wiki/Japan_Air_Lines_Flight_123
So "repair stuff properly" seems to be the important thing there. ;)
Me, crying while flying a 50 year old Cessna 172.
Oh, luckily you are wrong this time: most planes at top airlines are replaced with more competitive ones, not because they depleted the airframe. The rest is replaceable - airplanes replace engines more often than some people change their socks and everything else is either regularly checked or replaced based on a strict schedule.
Replacing the airframe with a more competitive one is part of it, but part of the competitiveness is that you reach a point where you're having to do much more inspections and maintenance than a new plane.
For comparison, a car's life expectancy is maybe 3,000 hours or so. Airframe quality is way, way higher than car quality.
Also note that the GP pointed out that it depends on what the plane is made out of, so older construction from 50 years ago can have more longevity in a way that more recently-built planes will not.
Because of this all good airlines won't operate old airplanes. The few bad airlines can't operate very well because any country with a functional government will not allow you to fly an expired airplane. And so Boeing and Airbus have long order books to replace planes as they hit end of life. Of course airlines are limited to airplanes still in the current catalog, so they often cannot order the model that was working great for them 20 years ago.