This occurs e.g. with enchanted swords, potions, books, possibly with anything with additional NBT?
Some items "wiggle" up and down in the player main- as well as offhand, e.g. elytra (both enchanted as well as unenchanted, both undamaged as well as damaged), or dyed leather armour (but apparently not regular undyed leather armour), see video:
Undamaged unenchanted tools work (leftclick), e.g. you can mine blocks with a pickaxe, you can shovel dirt; but as soon as the tool is damaged, it ceases to work, neither pickaxe nor shovel can mine any further block.
Enchanted tools, also undamaged ones, don't work at all (leftclick), see:
Rightclicking though, e.g. hoeing dirt into farmland or creating a pathblock with the shovel still works, with damaged as well as undamaged, enchanted as well as unenchanted tools, see video: