When using script created unit groups and the members of the group are killed while carrying out a command, the number of unit groups does not appear to decrease according to show_detailed_info.
This scenario recreates the issue I'm seeing - each group remains valid even after the biter is killed by the laser turret before reaching its destination.
I left it run (with game.speed turned up) to show that the unit groups counter never decreases: