I have an idea. It's probably that you're enumerating over a non static group. I doubt the enumerator is designed to work if the group is changing contents while enumerating. So say there are 2 units the group, and you've deleted the first 1, and are now accessing index 1. That index might no longer be valid since it may repack the internal array, and there is only 1 element left (index 0).
Usually the solution to problems like this, is to iterate the group in reverse and remove things from the end. But, that doesn't seem to be much of an option here.
Or maybe this is just something else entirely. Well, good luck figuring it out.