I can confirm that units that die and are even removed by fully decaying are not removed from group objects. When you iterate through all elements of the group (the GUI pick every unit in group action) you will get picked unit as null for such units.
There are two solutions.
1. Remove the units from the group on death, this can be difficult to do at times as there is no direct mapping for groups a unit is in.
2. Periodically check through the group and flush dead units from it. Since all you get is a null pointer this requires one to swap the group with a new one built from the filtered results of the old group.
I would advise using one as it is the most efficient but requires you to specifically manage unit deaths (can be hard if groups are instance related or if you have a lot of them). Two on the other hand is much more easy to do and you could use an timer or a simple process counter (how many times the group was accessed) to determine when to garbage collect but it is considerably less efficient as you may end up processing groups that do not need processing as they have no dead units in them and each process is an O(n) operation.
Performing the clear group function on a group will remove all units from it, even dead units, and so return a group back to initial creation state. This means you can also get around the problem by clearing and rebuilding a group, a useful process for caches where there is a distinct correlation between all members of a group (such as all farm type units on the entire map). Obviously this is not viable for very weakly correlated groups or groups made from non-deterministic results such as a group consisting of important quest units (specific units that have no correlation) or a group made from a random subset of a larger group (the random subset is not deterministic when rebuilt so will be different).