How to reproduce:
Put an armor stand down and have a sword ready.
Hit the armor stand once.
You will notice, the sword takes damage, and no it's not a visual glitch, if you slowly hit the armor stand every second with your sword, eventually, the your sword will break.
Also applies to every other item that can be damaged by attacking.
Can confirm in 20w51a.