Basically, they have 2 ranges. First is the blast radius, and inside that, is the radius where you trigger the self-destruct timer. If you're inside the blast radius, but outside the self destruct range, killing them deals damage to you, without any prior warning.
I agree that it's harsh, but there is a mechanical reason why they sometimes kill you without lighting up.