My DS at 5 was exactly like this in settings with a lot of kids and not a lot of intellectual stimulation. If not engaged, he makes it his business to become class clown.

I attended a camp with him this summer where I had to be present all day (Suzuki Piano Institute). Oh my goodness, non stop hilarity in good ways and bad ways all day long(at 8 1/2). I had parents approaching me and asking me if he's involved in drama (he's not, but maybe that's an idea for an outlet). Except at his master class where he was continuously engaged and challenged. He has grown out of the worst of it. He's also homeschooled now, so it's easier for him to behave in groups when necessary. It is totally a group dynamic thing for him. Alone or with a small group of kids, he's fine. Just last night, I had to punish him for not behaving appropriately at his Campfire group.

Anyway, it has improved somewhat over time if that's any comfort!