I was fighting a mob in survival but then i killed myself with Flint and Steel
What it would show:
FunAndJokes555 walked into fire
What showed instead:
FunAndJokes555 walked into fire whilst fighting Spider
Seems /kill don't have effect after killing a mob, but in some other death reasons, yes.
Affected both Vanilla and Modded Minecraft.