Johnson got a motion of confidence. You gotta remember that it's votes that count, not what they say to reporters.
Jeff Flake and Susan Collins said all the right anti-Trump stuff, but voted reliably for the cruelty ticket.
Nevertheless, we will have a new Prime Minister in the UK from the beginning of September and this was not Boris Johnson's idea.
He was forced to go because he could no longer find sufficient people prepared to serve in his government and because the 1922 Committee of backbench Conservative MPs told him that, if he didn't, they'd change the election rules to allow a second vote of no confidence, which he'd certainly have lost.
The parliamentary vote yesterday was a vote of confidence in HM's Government, not Boris Johnson (the government had deliberately tabled their own motion, having refused a Labour one specifying that the house had no confidence in HMG while Boris Johnson was Prime Minister).
By voting against it, the Conservatives voted against an immediate general election (which they'd lose), not in favour of Johnson.