Minutes before this he was self-assuredly walking into the Senate saying how Palpatine’s rule was about to end and his faith in Vader and the Dark Side was misplaced. These words may be bluster, but at the same time they don’t reveal a deep conflict within Yoda. He seems to only question himself once he loses the fight, at which point he has decided to run off into exile before the speeder has even left the air parking lot. Maybe if we saw him gazing out at the still-burning Jedi Temple, the virtual camera lingering on the sadness in his eyes as he comes to a conclusion, it would be clearer that he views his failure as something more than losing a single fight. But that’s not in the film, and I don’t see why I should do Lucas’s job for him.
What changed between when Yoda’s talking big to Palpatine and when he says “Failed, I have”?
Nothing to do with the Jedi or the Republic, or the Sith or the Empire. What changed is he lost a fight. That’s kind of what we have to go on, and that’s really the only real interpretation I think you can get from the movie itself.
Not to mention, why does he realize he’s failed then of all times, if he’s talking about some grand centuries-long, galaxy-defining failure? I’d say even before the fight, even if Yoda won, Palpatine getting as far as he did shows that something at least had failed. If this was all actually in the prequels, why wouldn’t he say this right when it became obvious that Palpatine was a Sith?