The scoreboard objective criteria minecraft.killed_by does not work for some entities, mainly not for certain non-mob entities where you would expect it to work.
Possibly all non-mobs
- Create the objective
- Display it on the sidebar and set an initial value
- Get killed by an arrow (fired by dispenser, skeleton or yourself)
→ The score does not increase