Obama had a successful presidency, yet the Democrats lost. Perhaps as you say, Margaret, he was perceived as an anti-establishment figure while Hillary Clinton could not shrug off her ties to the establishment.

The Democrats lost not because of the last presidency but because the mantle was handed to another (perceived) anti-establishment candidate.