@abc3
As @Drrickryp said, GroupBy is not delegable to any data source of any kind.
You may check here for the reference:
Non-Delegable functions
Note that the list above is not exhaustive. There may be other non-delegable functions not specifically listed in the reference above. Sometimes it depends on what data source you are using, but GroupBy is not delegable to any data source in Power Apps currently.
ClearCollect and Collect are other notable functions that are not delegable. Note that even if you don't get the yellow triangle delegation warning, that does not necessarily mean that all parts of your functions are delegable. The only way to be sure, is to set the data row limit to a very low number like 1, perhaps temporarily during development only. If you get only 1 record when you should get way more during testing, then you may have used a non-delegable function somewhere. After you have finished developing, set the data row limit back up to the maximum, 2000, especially if you will be making use of non-delegable functions intentionally, expect to be using it on records pretty close to 2000 in number, and need the data row limit to be at 2000 in the actual finished app.
You should try what @Drrickryp said to use pre filtered and sorted views. You can also try other techniques like getting everything down to 2,000 records or less with other delegable functions first, and using the GroupBy only on the output Table that already has 2,000 or less records.
See if it helps @abc3