It seems that, in order for the OP’s proposed scenario to happen, group membership must change so significantly from Time 1 to Time 2 that the concepts of “Group A” and “Group B” (as entities that persist across both time points) become rather tenuous. (Or else the differences across groups and across time have to be really tiny.)
That is why the groups are more nebulous things “boys” and “girls” where the groupings are still well-defined even if all the members change. The effect can not manifest if the groups are fixed in advance for all tests.