The bug
When shooting normal arrows at endermen they will not get hit and they will teleport away. When shooting them with a spectral arrow they do the same but they will be marked with the spectral effect even though the arrow doesn't hit them. This also applies to the arrow of invisibility (and probably all other new arrows).
Shulker bullet / blaze(dispenser) fire charge also apply effect / fire to endermen.
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 27
relates to 6
Attachments
Comments 42
Also in BE, see — MCPE-156656
Endermen got hit by Arrow of Invisibility