There have been very few midterm elections in which the president's party gained seats. One was 1998, in which the backlash against the Clinton impeachment worked against the Republicans, and the Democrats gained seats while Clinton's approval rating went up since the public, in general, did not think that the issue was worthy of impeachment. Newt Gingrich was forced to step down as Speaker as a result. He did, after all, ascend to the Speakership because of a perception that he led the Republicans to the first House majority in 40 years in the 1994 election. The 1998 debacle was the final nail in the coffin of his failed Speakership.
Now, Donald Trump wants to re-litigate it, with Newt Gingrich as an advisor. I love politics.