If an entity (A) is attacked by another (B), B will be the attacker of A for 5s. That's how it works.
(And if entity C damages A, it replaces B as A's attacker).
But if A is damaged by another source than an entity, like a fall damage, a fire, a cactus, ... Then the attacker is not reset and we still detect B as the attacker of A.
If this is noted as "working as expected", which can be justified. Perhaps we could have a new argument for "/execute on": "victim". That way we could know who the victim of the entity's last attack is. Because "target" does not work on players.
That's absolutely by design, or the "whilst" death messages will be unable to trigger, along with "was doomed to fall by X".
The last note has no relation to the report...