See summary. This bug probably occurs due to the trident's entity being derived from the arrow entity.
How to reproduce:
Summon 3 creepers in a row that have
NoAI
setPut down a repeating command block, set it to "Always Active", and put in the following command:
data merge entity @e[type=trident,limit=1] {PierceLevel:3}
Throw the trident at the creepers, then replace
trident
witharrow
Shoot the arrow at the creepers, they all get hurt
Then replace the command in the command block with the following command:
data merge entity @e[type=trident,limit=1] {ShotFromCrossbow:1}
Throw the trident
Can confirm in 21w05b.