I've had a sheep leave its pasture 3 times now overnight. The impression I have is that it happens when a new lamb is born. Last 2 times it was a male who was in a different pen than the other animals (didn't want him to be the breeder), and when I woke up both times, there was a new lamb born. I'm guessing maybe it has something to do with trying to impregnate the ewe that just had a baby, but I have no idea what's really causing it, or if he's somehow managing to do it (since the new babies weren't born yet). The fence of both pens is about 7 tiles from each other, no idea if it would matter at all. Also, I am using a food through as part of the fence, but there's definitely no gap in it.
Just for the record, I live alone, so it isn't someone trolling me... hehehe