The out of power party almost always does very well in an off year election. Plus the economy is not as strong as it could be. What caused the Republican's to do so poorly? One reason above all others:
Fear that Trump may win the Republican nomination and election in 2024.
If Trump wins the Republican nomination in 2024, the danger will be that must closer. Instead of needing to win both the primaries and the election, Trump will now be just one step away. Voters will vote, not only against Trump, but also against Republican candidates for the House and Senate. As additional insurance, that if Trump somehow wins, he will get no support from Congress in any efforts to nullify future elections. The Republicans will be setting themselves up for a huge defeat.
Of course, this decision, to nominate Trump or not, is not up to the Republican leadership, but to the millions of Republican voters. If I was a Republican voter, I would be urging fellow Republicans not to do this. The definition of stupidity is doing the same thing over and over again and expecting different results. As the voters have gotten to know Trump better and better, they have turned against him more and more over time and there is no reason to think that this trend is going to reverse. It may be tempting to choice a course, that if it works out, you don't have to worry about losing elections in the future. But this is a course that is bound to fail, as it is also Un-American.