Quick question about the hammer

So basically Ive been noticing that when you melee a person who has the hammer with your weapon or sword sometimes you die for no reason. I know there is a parry mechanic when 2 swords clash or a sword and hammer clash but I’ve legit beaten my opponent with better timing just to die without him swinging the hammer. Am I missing something here?