Bubbling is a natural occurrence. Milk contains protein and when protein is shaken bubbles will be formed. Same principles apply to the egg when its beaten it becomes foamy. But if this is an unusual case the bubbling might be due to a few things:
If the water temperature is hot, the structure of the protein will change hence forming more bubbles.
The more violent the bottle was shaken, more bubbles will be produced due to the natural reaction.