Yes. The commercial hens, of which many leghorns bought from hatcheries are indeed commercial strains, will lay best for only their first two years. They'll continue to lay, but at much reduced numbers. It is true that a more heritage bird will lay about the same number of eggs over their life time, but from a purely economic point of view, not admittedly from a "pet" point of view, a simple matter of math comes into play.
600 eggs laid by a leghorn in 2 years costs only 2 years worth of feed, bedding, electricity, etc.
600 eggs from a more tradition breed might take 4 years or even 5 years. That would be 4 or 5 years of feed, bedding, electricity, etc.
Easy to understand, really. I keep both kinds of birds for different reasons.