See my tagline.
Read the Twelfth Amendment.
In 1876 the election was decided _one_ _day_ before the expiration of President Grant’s term.
One day.
I leave it as an exercise for you to figure out how that happened...
Hint—the state certifications didn’t mean squat.
If you think the courts or congress are going to step in, you’re deluding yourself. And Trump by himself can do nothing. Sorry to pour cold water, but that’s reality.