Pretty much the only time this was a realistic possibility in recent memory was 2004. Kerry might well have won Ohio and the EV while losing the PV.
Assuming an uniform swing, didn't the EC mathematically favor Obama in both his runs?
It did. Favored GOP (decisively) in '00, Dems in '04 and '12, GOP decisively in '16 again, and ambiguous in '08 due to relative closeness in disparity between the parties + large 7-point overall Obama margin, so it's not safe to assume uniform in 08. But probably Dem that year too, he performed about as expected in the EC but fell short of his national polling by a bit.
P.S. by decisively i don't mean a big difference, just that it "changed" the winner, of the election