Think the difference here is expectations. As a forward you can reasonably expect a goalkeeper to be diving at your feet and you need to consider your actions in that context. However you do NOT expect a defender to try and head a ball that is inches off the ground, regardless of his starting position. As @GraemeS says, the defender has done something contrary to the LOTG. If he'd gone with a leg instead then we'd be viewing the actions of the attacker as (most likely) Careless or (at worst, if we felt he was very late) Reckless. I see no reason to change the sanction for the attacker just because the defender has done something ludicrous ....
There is no difference though, he is just a defender who can use his hands..
The piadm is fine when a player holds ball between legs and invites trouble, or, someone for no reason falls to their knees to header a ball on the ground
This defender is already grounded and has not put himself in that position to endanger himself, its been a natural act and other thsn screwing his head off until its safe, there is nothing he can do here to avoid being scunnered
The lotg dont say its not ok to kick a grounded gk but its ok to kick a grounded defender. Both are classrd as, opponents