Hi @aro1 :
Firstly,could you tell me what your data source is?
Generally, the data sources that can be delegated include: SharePoint\CDS\SQl Sever.
Secondly,The output of AddColumns(……) is subject to the non-delegation record limit. In this example, only 500 records are returned even if the TaskNames data source has 501 or more records.
I think this link will help you a lot:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping#description
The only way I can think of is to adjust the value of Data row limit for non-delegable queries to 2000.(As @Drrickryp said)
file-Settings-Advanced settings

Finally,If the number of records is greater than 2000.The data source can be segmented and saved in batches to a collection.(The data source must be delegateable)
I assume TaskNames is a SharePoint list and "Kind" is one of the text type fields
For example:
1\Set the app's OnStart proeprty to:
Clear(MyTaskNames)
Collect(MyTaskNames,Filter(TaskNames,Kind="Kind1"));
Collect(MyTaskNames,Filter(TaskNames,Kind="Kind2"));
……
2\Try this code
Filter(AddColumns(MyTaskNames,"helperTaskAverage",Sum(Filter(collectionAssignedCompleted,Task=TaskName),TimeSpentOnTask)/Count(Filter(collectionAssignedCompleted,Task=TaskName).ID)),helperTaskAverage>0)
Best Regards,
Bof