Pedro is giving the solution. This is a known bug in Outsystems when adding grouping to your aggregate that uses dynamic sorting. You can clearly see this in the executed sql of your aggregate.
After adding grouping, and before deleten and re-adding the dynamic sort :
SELECT TOP (12) [ENSAMPLE_EMPLOYEE].[FIRSTNAME] [EMP_FIRSTNAME], [ENSAMPLE_EMPLOYEE].[ID] [EMP_ID], [ENSAMPLE_EMPLOYEE].[LASTNAME] [EMP_LASTNAME], Sum([ENSAMPLE_ACCOUNTS].[OVERDRAFT]) [ACC_OVERDRAFTSUM]
FROM ([EDJUWJ010].dbo.[OSUSR_MLE_SAMPLE_EMPLOYEE] [ENSAMPLE_EMPLOYEE]
Left JOIN [EDJUWJ010].dbo.[OSUSR_MLE_SAMPLE_ACCOUNTS] [ENSAMPLE_ACCOUNTS] ON ([ENSAMPLE_EMPLOYEE].[ID] = [ENSAMPLE_ACCOUNTS].[CREATEDBY]))
GROUP BY [ENSAMPLE_EMPLOYEE].[FIRSTNAME], [ENSAMPLE_EMPLOYEE].[ID], [ENSAMPLE_EMPLOYEE].[LASTNAME]
After deleting and re-adding the dynamic sort:
SELECT TOP (12) [ENSAMPLE_EMPLOYEE].[FIRSTNAME] [EMP_FIRSTNAME], [ENSAMPLE_EMPLOYEE].[ID] [EMP_ID], [ENSAMPLE_EMPLOYEE].[LASTNAME] [EMP_LASTNAME], Sum([ENSAMPLE_ACCOUNTS].[OVERDRAFT]) [ACC_OVERDRAFTSUM]
FROM ([EDJUWJ010].dbo.[OSUSR_MLE_SAMPLE_EMPLOYEE] [ENSAMPLE_EMPLOYEE]
Left JOIN [EDJUWJ010].dbo.[OSUSR_MLE_SAMPLE_ACCOUNTS] [ENSAMPLE_ACCOUNTS] ON ([ENSAMPLE_EMPLOYEE].[ID] = [ENSAMPLE_ACCOUNTS].[CREATEDBY]))
GROUP BY [ENSAMPLE_EMPLOYEE].[FIRSTNAME], [ENSAMPLE_EMPLOYEE].[ID], [ENSAMPLE_EMPLOYEE].[LASTNAME]
ORDER BY Emp_LastName
@Stefan Weber : for grouped or calculated data coming out of the aggregate, it is normal that there is no entity qualifier in the tablesort name.
Dorine