Looking into this, I start to believe that on every sort action, you need to sort your entire entity list and recreate the groups with your groupBy function.
Best example of what I have found: Stackblitz