If you set a value to a parameter (even Text), there's no way to get it back to "blank", and will therefore not group with other (new) elements properly. This example schedule is being sorted by Level, Type, z Offset, & Comments:
WORKAROUND: In order to get the highlighted elements to display (group) correctly, you need to set the "empty" one to a value, then delete it (since Revit treats an empty string as different than a null value) so that it groups with existing elements that had their Comments field used & cleared. The problem is that you need to MANUALLY do this for ALL new elements from then on...
FYI, the schedule above is being used to do some QC correction (a user had incorrectly used both Type and Element comments instead of the Type Mark parameter).
Related idea & discussion:
Null value needed for dimensional parameters with scheduling capability - to display the null in a schedule as a "-", "---", "n/a", etc. [should make separate idea for casting dimension to a string]
Reset Numeric parameter value back to 'empty' - for an Integer parameter to be blank instead of showing "0" (zero), with steps to reset to null if it's not a built-in parameter?