I dont know if the barriers would keep them in, but if they did it seems like the centaurs (being the proud creatures they are) would not be happy that wizards were confining them. So i just want to know if they can leave the grounds.
Flying creatures can leave.
We have at least two examples of winged animals leaving the Hogwarts forest: Buckbeak and the Thestrals.
Buckbeak flies away with Sirius:
He squeezed Buckbeak's sides with his heels. Harry and Hermione jumped back as the enormous wings rose once more... The hippogriff took off into the air... He and his rider became smaller and smaller as Harry gazed after them... then a cloud drifted across the moon... They were gone.
Harry Potter and the Prisoner of Azkaban, chapter 21: "Hermione's Secret"
Harry & Co. fly the Thestrals to the Ministry:
For a moment his thestral did nothing at all. Then, with a sweeping movement that nearly unseated him, the wings on either side extended, the horse crouched slowly and the rocketed upward so fast and so steeply that Harry had to clench his arms and legs tightly around the horse to avoid sliding backward over its bony rump. He closed his eyes and put his face down into the horse's silky mane as they burst through the topmost branches of the trees and soared out into a bloodred sunset.
Harry Potter and the Order of the Pheonix, chapter 34: "The Department of Mysteries"
So evidently there's no problem for the winged creatures leaving... when they want to. The thing is, I don't think most of them want to very often.
Think about it - most of the creatures that live in the Forbidden Forest don't really have anywhere else to go. In the Forest, they have Hagrid to care for them and a forest environment where there are other magical creatures. It's a thriving environment that doesn't really exist in other places. Leaving the Forest would probably be a bad idea, because then they'd lose the protection that the Forest/Hagrid provide and the foodchain.
As for the centaurs, I think what I said above also applies - they don't really have anywhere else to go. The Forest provides a safe home, with food, where they are (mostly) free to live in peace. They have no reason to leave.
I would like to think that the creatures in the forbidden forest are not confined in Hogwart's as Buckbeak/Witherwings was able to fly out. This means that there are no magical boundaries that prevent the animals to come out.
In my own opinion, the animals stay in the forest as it is safe and a perfect place for living as a creature