The greatest prison in the world might only be called that by default...like, yeah, it’s the hardest place to break out of for most people, but that doesn’t make it impenetrable.
They’d have to gather all the Seastone in the Grand Line just to restrain them, and even then, they’re so insanely powerful that it might not make a difference. As strong as Magellan’s been shown to be, any of the Emperors would wreck his shit and think nothing of it...Big Mom and Kaido specifically would then turn the Jailer Beasts into playthings or crewmates, respectively, then waltz right out of the joint.