Blocks which are mined quicker with a sword should not take 2 durability points when broken with a sword (per MC-195168 being a valid bug). However, certain blocks like leaves are in the #sword_efficient tag, whilst still being broken faster with a sword, still reduce the durability of the sword by 2.
Affected blocks
All Leaves
Big Dripleaf and Dripleaf stems
Carved Pumpkins
Chorus Flowers & Plants
Cocoa Pods
Glow Lichen
Jack o Lanterns
Melons
Pumpkins
Vines
Steps to reproduce
Look at leaves and with the debug screen observe that they are in the #sword_efficient tag
Break them with a sword in survival mode
Notice the sword takes double durability damage ❌
Expected results
Swords would take double durability damage only when breaking inappropriate blocks like dirt
Observed results
Swords take double durability damage even when breaking blocks like leaves which are in the #sword_efficient tag and thus swords are an appropriate tool for breaking
Can confirm.