I'm not sure I follow you, Merroe -- are you talking about
Bilbo or
Gollum here? These are two different incidents:
the Ring left Gollum, Bilbo left the Ring.
As for the argument in
Bag End, we know
Gandalf sometimes displayed a short temper, and did not suffer fools (or foolish behavior) gladly; the way I read it, it is not Bilbo's refusing to give up the Ring that angers him, but the accusation that he wants to "rob" him of it:
'Well, if you want my ring yourself , say so!' cried Bilbo. 'But you won't get it. I won't give my precious away, I tell you.' His hand strayed to the hilt of his small sword.
Gandalf's eyes flashed. 'It will be my turn to get angry soon,' he said. 'If you say that again, I shall. Then you will see Gandalf the Grey uncloaked.'
This seems explicit, when Gandalf says:
'I am not trying to rob you, but to help you.'
This, of course, after they had both calmed down a bit. Bilbo had known Gandalf for many years, and the accusation that he might try to rob him, or do anything to hurt him, would naturally rouse his ire.
Remember that at this point, Gandalf knew little about this particular ring, other than, as he later tells
Frodo, that it was one of the Great Rings; so Bilbo's words come as an unexpected shock to him, and he reacts in anger.
I'm not sure where "uncloaked" entered the story; the first chapter was written and rewritten many times, and in fact, it was originally
Gandalf who came up with the "joke" -- the necessity of passing on an accursed object with a "light heart" is a common motif in folktale. I'll try to find the relevant text in HoME, but I'm not certain Christopher
Tolkien included it.
In any event, I wonder if the author himself was entirely clear on the meaning of "uncloaked"; certainly not something like Zeus and Semele, and anyway, the
Istari were "forbidden to reveal themselves in forms of majesty". I think it would likely have been an intensification of what did happen:
He took a step towards the hobbit, and he seemed to grow talk and menacing; his shadow filled the little room.
This alone was enough to have a salutary effect on poor Bilbo! And that was no doubt the intent.