Read Exodus 21:34 Using Other Translations
The owner of the pit shall make it good, and give money unto the owner of them; and the dead beast shall be his.
the owner of the pit shall make restoration. He shall give money to its owner, and the dead beast shall be his.
The owner of the pit must pay full compensation to the owner of the animal, but then he gets to keep the dead animal.