There's something tautological about saying someone "wasn't well-liked enough" to get elected. That's why everyone loses an otherwise fair election.
An equally compelling and even simpler narrative is that it's simply rare for the governing party to hold on to the White House for 3 consecutive terms. The opposition party gets to run a "change" election that the incumbent party can't. For a second term in office, where the incumbent party can run the same candidate, they can run a "continuity" election that more often than not beats "change". But they can't do it for a third term, and so the opposition simply tends to win that term.