By the OP’s own statement, he saw the yellows, tried to pass, and the lights turned red and the sign came out when he was about even with the drivers window. He tried to pass and didnt get it done before the stop sign showed. Knowing full well that the bus driver controlled that timing, thats a chance he took, and it did not work out.
IF he gets the citation, AND IF the bus has a camera that shows him in that situation (these two conditions are not yet known), THEN there is little to no chance of getting out of it. No judge would want to set the precedent of allowing vehicles to scoot around busses “because they thought there was time”. To think otherwise is foolish, IMO.
If it goes to court, my guess is a fine, court costs, and a butt chewing from the judge about common sense and wasting his time.