Well the account of the messenger isn't as plausible as he might hope it to be given that Gandalf knows that Frodo was carrying the ring, which the Messenger doesn't. And the passages has little hints which I think would reinforce this idea that it is not plausible - while not actually telling us what Gandalf thought.
Such as "No-one answered him, but he saw their faces grey with fear and the horror in their eyes, and he laughed again, for it seemed to him that this sport went well".
Why say "seemed to him" - narrator would only say that to highlight that to at least someone else, it didn't seem so convincing. That someone else could be Gandalf, and possibly some of the other more thoughtful ones such as Aragorn.
Especially since just before that, Gandalf says about the tokens "Indeed, I know them all and all their history, and despite your scorn, foul Mouth of Sauron, you cannot say as much".
It would be obvious to Gandalf, and anyone else who is able to reflect and think clearly in such a difficult situation - that Sauron can't have captured the ring. Otherwise, why this dallying? Why produce a mithril shirt and not mention the ring? If they had the ring, all would be over already.
So - just as the Messenger is trying to find out what Gandalf knows, Gandalf is also trying to find out what the Messenger and Sauron know.
I read it as despair amongst the others. All the darkness and despair is a collective "A blackness came before their eyes..."
But - I don't think we should assume that the same thing the narrator describes there collectively is an emotion that also swept over Gandalf. In this entire passage it never says what Gandalf himself felt, just what others thought he felt.
I think nobody else is able to read him at this point and he already knows right at the start of the conversation that Frodo can't be captured, or at the very least that if he has been, Sam must be free, otherwise why hasn't Sauron got the ring?
That passage "but those nearby saw the anguish in his face, and now he seemed an old and wisened man, crushed, defeated at last. They did not doubt that he would accept"
Well the thing is that his companions are unreliable witnesses in this sort of situation. We already saw that earlier with Saruman where his companions were sure that he would ascend into the tower and discuss higher matters with Saruman. Until Gandalf's laugh breaks through it all.
So - I see that as them reading his face but coloured by their own perception, seeing him as defeated because they felt defeated themselves. I don't think Gandalf himself felt defeated at this point. As his following actions show.
I read the rest of the conversation as Gandalf trying to find out more.
And when he says "Or else his errand was one that you did not wish to fail? It has."
That totally confirms to anyone who has the presence of mind to reflect on things that the Messenger hasn't got a clue what Frodo's errand was. And though few would have that presence of mind in a situation like that, surely Gandalf has.
For us (because we have read the book so have special knowledge) but also for Gandalf, as the conversation goes on, it is clearer and clearer that the Messenger doesn't know what Frodo's errand was.
So - then the main question for Gandalf is, does he have Frodo? Could he have Frodo but not the ring and Frodo have somehow resisted questioning?
So he asks the Messenger to bring him forth, and watches him intently. When he sees the Messenger momentarily pause, then I think at that point Gandalf already knows that they don't have Frodo either.
And at the end Gandalf says "Get you gone, for your embassy is over and death is near to you."
That has two purposes. First reinforces their continuing pretence that they have the ring bearer in their midst and are confident about overpowering Sauron. Because he knows that is how the Messenger will read it.
But also - it's a prediction, encouraging his own side at the same time - that he knows that Sauron doesn't have Frodo at that point.
And he may then already begin to think that Frodo is close to success, to have managed to continue so far without being detected.
We don't get to see Gandalf talking to the others and I think throughout that we really don't see his thoughts at all - because the battle immediately commences after that.
The narrative instead turns to the point of view of Pippin - of all the onlookers perhaps one of the least likely to have figured out that Frodo has to be free.
So I don't think this encounter that we see Gandalf's thoughts on the matter at all except indirectly. Which is part of the fun of the narrative.
Tolkein is a master of this, the art of presenting story lines using unreliable witnesses :).