Earlier on in my career I would read stories from tech companies that said something like "if you don't get promoted to a certain level within 2 years then you get fired." Initially I thought that was pretty harsh. Now, I understand where it comes from. If someone hasn't shown progress in 2 years, assuming proper feedback, it's doubtful that they'll ever improve much.
On the other hand, I believe there are places for average engineers. Part of the issue with this person is that they wanted to keep trying to do more complex work even though they struggled with easier tasks and it was a constant struggle to try to balance that.
I think in retrospect, had I been the person's manager, the best option would have been to restrict their work to the easy tasks. If they didn't like it then they could always leave. I now also understand why some people are "managed out". Maybe they can stay in their role but if they don't have the ability to progress then I don't think it's a manager's duty to help them beyond a certain point.