A possible reason for this is that a group is created without any attached permission level. The Change Group Setting page allows to do this, the result is that the Groups collection of an SPWeb instance doesn't contain the created group. Solution: attach at least one permission level to the group on the group settings page :-) .