Another way to look at it is that from Cersei's POV Tommen had betrayed her for Margaery and High Sparrow, and betraying Cersei always ends with just this, absolute and utter destruction.
Not only that, but what would have been the likely conclusion of the trial? Either execution or lifetime imprisonment in the dungeon, or public airing and proving of the incest charge with Tommen losing his throne and Cersei her position anyway, which she had fought to cover up the whole time. As a practical matter Cersei herself was facing doom.