It is a visual bug that can occure from time to time. Where the mob received either just enough damage to die over time, for example due to any posion effects or where there is a graphical delay where your pc doesn't update that is has been killed.
As for a solution indeed porting in and out will make it dissapear, but that is largely impossible. An easier solution is to manually target a different mob or pres f1 to target yourself to reset HK so it will reset hk and select a new target.
In party you'll see it happen more often that your character will stare at a mob with little hp but doesn't attack it, this might occure due to other party members dealing it enough damage to kill. Why it isn't show yet is the extreem high attack speed, some animations aren't able to keep up and cause a delay over time. If you watch long enough the mob will dissapear and you start attacking again.