If they can bring Jon and Benjen back literally from the dead then finding Gendry sitting fucking about in King's Landing was hardly ridiculous. Okay it didn't play out like I expected, but it wasn't out of the realm of possibility. As amazing as it was to watch, Cersei has chosen the worst path. In putting herself on the Throne she has alienated the Tyrrells who were keeping the Lannisters in power and feeding her people, The remaining Lannisters and Jamie. In removing all the threats to her power she has also removed almost all her remaining support, all she has is her Mad Shagger Mutant Bodyguard and the mad hatter who made him.
It's a very long shot but even tho he killed his Father, Tyrion still has a claim to the Lannister house. He could argue that he is the lesser of two evils aka "Who would you want in charge, a dwarf or her?"
Jamie could also forgo his vows to the kingsguard and take over the house and break away from Cersei after her actions.