Its a bug you could say, u are hitting a spot where you touch the hitbox but also the hurt box of the enemy at the same time, it’s a pixel-perfect thing.
I think I got bad luck man, it has happens to me a few times. But I did enjoy the game.