This is also happening to players, making them living and dead at the same time (they aren't targeted by mobs, but they can't pick up any items), their Health and AbsorbtionAmount NBT tags get set to "NaN".
The only way I found to unstuck them is to modify their playerData with an external NBT editor
Edit: It seems to be caused by critical strikes