Working today found a issue where if you group by the same field twice it gives an incorrect result, replicated this with a simple example below. I also tried it on an older version (2021.4.2) and it does not happen there.
Inputs:

WHen goruping by one field, works as expected

When grouping by the same field twice, gives wrong result:

Version:
