Unfortunately I don't have a good documentation on this particular bug. But I penned both my cows side by side across a wicker fence. The fence was not fully enclosed, but you could not cross the pens due to hitbox blocking. The pens had a single tile spacing in the wall (character can fit through), and the oven corner is unpathable even to a character. Despite trying I couldn't get cows out a single tile wide hole in the fence.

Events: My bull teleported into the female's pen. And shortly later while I was watching the female teleported out of both pens entirely and was wandering around outside.
I'm fairly certain the female teleport happened without lining up with the corner either, so the motion was directly over a wall.