I think it could become quite tricky especially if there are multiple sorting intended. Personally I would split the task and checking the sorting separately by a more/less reduced number of dimensions/expressions to ensure that each part alone worked like expected. After that combining the single parts step by step to find those combinations which seems to cause the issue.
Beside this using calculated dimensions may make things much more complex because their logic would need to be included within the sorting. Further it might be necessary to apply already a dynamic sorting within the aggr() itself and/or to use dual() as calculated dimension whereby the numeric part contains the wanted sorting.
Another potentially cause is the use of rowno() within your expressions because it disabled the sorting.