Yes, we have tons of bad legislators: some just not good at their jobs, some actively harmful (leaving that vague on purpose—I think all partisans can agree that they exist, even if we disagree on who they are). In theory, they can be excised via the ballot box. However, we don't want to kick out the good ones just as they're getting to be their most effective—not only do we lose their direct skills, but we lose their ability to mentor the promising up-and-comers.
I place more blame on the way we do primaries and general elections: in most districts, the only thing that matters is the primary, and that produces some truly rotten results.
Who cares? They don't get to cast the votes.
https://www.rollingstone.com/politics/politics-features/dian...
As long as things are staggered, senior legislators will mentor junior legislators, and that institutional knowledge will be passed on.
And I don't think we're talking about limiting representatives and senators in the same way we do for the president. I would say it would be fair to allow them to serve for something on the order of 15-20 years.
But sure, I think there are many other problems that matter more: winner-takes-all elections that essentially require you have only a two-party system, the electoral college, and (as you mention) the primary system.
While we're at it, let's put terms on the Supreme Court, too: rather than for life, make an appointment last 18 years, staggered every two years.
Related gripe: How both houses of congress prioritize "seniority", so that changing a representative indirectly harms the interests of the people being represented. (Though possibly not as much as keeping the wrong representative in office.)
In other words, State X benefits more when their seats are _not_ competitive and subject to turnover, the quality of candidates being equal.