I'm reading 'The Challenge' by Andrew Lambert about the naval history of the War of 1812. The author mentions that just before the fight against The Chesapeake, The Shannon threw the goats overboard. No explanation as to why this was done is given.
They were likely dumped overboard so that their manger could be cleared for action. Most ships made a clean sweep of the decks, forward and aft, to remove any unnecessary bulkheads or other construction that could be turned into splinters by enemy shot.
The Shannon was known as a particularly keen gunnery ship, and while they would not toss the livestock overboard in the course of normal sailing/practice, it wouldn't surprise me if they did that before an action. (I haven't read the book, so I can't say for sure where he cites that from.)