Matching of the tail of all groups would continue if any matched, leading to (aa|bb) matching the string ab. Also, any empty group would mean continuing to match the rest of the terms, ignoring a non-empty matching group. This lead to (aa|a) not matching the string a.
In that case, the exact same MatchGroup would be fed to simplifyTerms again. Now, it is returned immediately, and only the rest of the terms are simplified.