When you shoot a mob that has armor with thorns enchantment, you still may be hurt.
Also, if you have armor with thorns and skeleton shoots to you, skeleton will sometimes receive thorns damage.
I think it doesn't work as intended, because thorns enchantment should only affect melee combat.
1. Equip armor with thorns enchantment
2. Be hurt by skeleton's arrows
3. Skeleton will sometimes receive thorns damage (for thorns VII chance is 100%)