When you are using Aggr(Sum(....), the assumption is that there is only one value available after the inner Sum() is completed and that one value will be displayed. If for any reasons, there are more than one values, you will see - (null). Aggr(Sum(...) can be written like this Only(Aggr(Sum(....)) as they essentially mean the same exact thing.
Now Sum(Aggr(Sum(...)) is saying that if you have multiple values, then the expression should Sum those values and display it.
Here is an example for you to look at
I wanted to sum those rows where Dim2 began with D.... Since there are two such rows, the one without Sum() gave me null. Where as the one with Sum() gave me the right sum.