The assertion exists to ensure all variables passed into trackAssignments end up with dbg.assigns associated with their backing allocas. The assertion compared the passed-in and tracked variables using DebugVariable, which includes the fragment as part of the variable identity.
It is possible for the backing alloca to be smaller than a variable (see test case). In this case the input variable (Var X, no fragment, no InlinedAt) isn't equal to the dbg.assign variable (Var X, some fragment, no InlinedAt). To cover this case the assertion now ignores fragments through the use of DebugVariableAggregate.
It's worth dropping a comment here indicating why you've used DebugVariableAggregate instead of DebugVariable, to let the reader work out that the fragment can be changed by AT.