When Link hits an enemy while his sword is charging, sometimes he'll move to the swinging sprite, and the sword will appear in the corresponding position. I think it takes a couple enemies, or stabbing the wall, or maybe a combination of the two to trigger this
Hitting Enemies While Charging...
Not a bug. See: every 2D Zelda game since LttP.
Yes, it is a bug. I just wasn't clear
When Link touches an enemy with the charging sword, he won't stab at it, like you're thinking. His sprite will change to the slashing sprite and stay that way, and his sword will be placed where it first goes when Link swings, and stay there. It will stay like that, in the first frame of a SWING animation until you release the button, in which case he'll do a spin attack
Like, he tries to swing his sword at the enemy instead of stabbing, but gets stuck like that. I'll see if I can get a screenshot

Normal charging. Ignore the funny sprite

The state after he hits an enemy with a charging sword (I changed direction on accident). He will stay EXACTLY like this, even while moving around. Once you release the button, he'll attack
While we're on the subject, if Link gets damaged while in the bugged state, he'll revert to his walking animation, but will only face the direction he was facing when he got hit, and can't use any items until he leaves the screen