We can only speculate, as we'd be in largely uncharted waters, and I'm sure it'd be fruitless speculation anyway because no way Francis is that dumb.
When Pope Honorius played cute with the Monothelites, he served out his term but then was stingingly rebuked for it by a later Pope and ecumenical council.
It would probably be best for a modern heretical Pope to be shown the door, yes. If he in any way resisted, to the point where the faithful were unsure who was Pope, there would probably have to be an Ecumenical Council called. Benedict XVI may feel compelled to step in.
But like I said, I don't believe Francis is that dumb, and he's not a big fan of the whole gay thing anyway.