I've seen a ewe push her head between pallet wood, have a wether who climbs anything and everything, and had a ewe who was a jumper, regardless of what she was trying to get over.
Maybe breaking the pallet wood up back into slats, removing all nails, and attaching to the wooden posts might be a better (but hard work) idea. Check for safety distances between the 'rails' before you attach to the posts, including the distance between ground and first rail.