That "repurposing" is more morphology than grammar. You also frequently find in Indo-European languages multiple cases having overlapping morphology, but that doesn't necessarily change the cases themselves. My point, in any case, is that Hittite has the older animate/inanimate genders from Proto-Indo-European (only attested in the Anatolian languages!) whereas Sanskrit has the later masculine/feminine/neuter genders.