The bug
When a player attacks certain mobs in peaceful mode, the mobs still tries to attack the player, however it doesn't deal damage to the player and stays in the attacking animation until it is no longer wants to attack the player.
List of affected mobs
Bees
Dolphins
Llamas
Aggressive Pandas
Polar Bears
Wolves
Iron Golems
i think this also happens with wolves