You don't need to sort anything in BuildMasterList. There's SortScrollList for that, it's called after the list is filtered to sort only items that pass the filter; and also when sort order changes, the list is not rebuilt, just sorted again. I'm looking into SLE and it looks like everything's in place.
Try this in UnitList:Initialize():
Lua Code:
units.sortHeaderGroup:SelectHeaderByKey("name", ZO_SortHeaderGroup.SUPPRESS_CALLBACKS)
edited: wrong member name