It has happened to me multiple times before.
When it happens, it is always after the game crashed early game.
I've seen many people post clips here with questions about why they were not hitting their enemy and always people will say 'git gud' or something. But I don't think it can be any more clear in this clip that that is not what was going on here.
Feels bad. In the end, I just let him get up close to me and npc-killed me.