It does not work out to about 5 years. The number of years is completely disconnected from the numbers that actually matter. The numbers that matter are the cost of the SWG and the amount of chlorine it produces. That is what a SWG is, a device that produces chlorine. It will produce a fixed amount of chlorine over it's lifetime regardless of what size pool you install it in. It makes no difference to the SWG if it products that chlorine in 6 months, or over ten years. Baring accidents the total amount of chlorine is constant regardless of how quickly you have the SWG produce it.
Smaller SWGs cost less, and produce less total chlorine over their lifetime. Larger SWGs cost more and produce more total chlorine over their lifetime. The total cost per unit chlorine works out to be similar in both cases. There is a small cost advantage to buying the larger SWG (for most brands, a few work out the other way), but it isn't a significant advantage in this context.
Using the smaller SWG on a small pool for more years has exactly the same cost implications as using that same small SWG on a larger pool for a shorter number of years In both cases you are producing exactly the same total amount of chlorine and paying exactly the same amount of money for that chlorine. A SWG is a tradeoff in money spent up front for a fixed amount of chlorine produced over the lifetime of the SWG, vs paying for some other form of chlorine over time. It makes no difference if you are getting that from a larger SWG or a smaller SWG or how many years they last for. What matters is how much you paid and how much chlorine you get out, which are both unrelated to the size of the pool you are running the SWG on.
Undersizing is about having to manually add chlorine because the SWG is already at 100% and simply isn't producing enough chlorine. As long as the unit can keep up with the pool, even if that means running at 100%, then all is good. Obviously failing to keep up and having to add chlorine manually matters. It might not be a problem for everyone, but that is something you want to know about. Everything else is trivia, possibly interesting, often debated, but not really important.
Yes, some brands are less expensive to use if you buy their larger SWG, but that remains true regardless of what size pool you use that larger SWG on. And for that matter, some brands get more expensive to use when you buy their larger model, and again that remains true regardless of what size pool you use those units on.