The presence of the ground is equivalent to the absence of a third dimension. Thus irrelevant.
I see no reason to expect additional dimensions to make a fundamental difference here. This isn't a complex topological problem involving the constraints of graph connectivity. It comes down to nothing more than immediately available space, maintaining it as a group and making use of it as an individual.
Consider a tightly packed group of runners. If someone in the center goes down they'll likely be trampled and it's also likely to cause a mass pileup.
If birds were prone to that you'd expect the occasional collision at the center of a dense flock and a bunch of birds falling out of the sky as a direct result. Yet I've never once heard of that. The simple and obvious hypothesis is that they are hardwired for group navigation in a way that the vast majority of other animals aren't.
If you're having trouble seeing the point I'm trying to make here then try swapping out the example with runners for one with a fleet of planes. A swarm of hundreds of modern fighter jets in a dense 3D formation actively maneuvering in randomized arcs without any sort of pre-planning or rehearsal. If something went wrong can you really imagine all of the pilots successfully avoiding collision every single time? The birds around here put on shows like that multiple times every day.