I had a strange experience with this the other night. I pitched it directly into my carboy - the temp was a bit warm 78ish but it was late. Woke up the next morning and no bubbles in the air lock yet so I gave it a shake to aerate it and the head space in the 6 gal carboy instantly filled up and foam was spraying out through the air lock. It was like I dropped a mentos into a coke.
First off… never ever NEVER pitch any beer that warm. EVER! Bad idea for just about any beer IME. But especially not weissbiers. Generally you don’t want to pitch until they are in the low 60’s or high 50’s for best results. Temp control - and even yeast pitching temps - is one of the single most important things you can do to improve the character of your beer. I never pitch any yeast over 70 degrees, ever.
As far as what happened. The yeast was working and generating Co2 which was trapped in solution. When you shook the carboy it was like shaking a 2 L bottle of soda. I’ve had this happen a few times as well.