i think that the sort function is only taking alphanumeric characters into account - ie it is ignoring the '-'
so when you get
CATTE-CAVAJ-22 - ...
CAVAK-CAVANQ-23 - ...
CAVAR-CAZ-24 - ...
C-CAE-52 - ...
CC-CECC-25 - ...
CECE-CELL-26 - ...
CELN-CENTO-27
what the function sees is
CATTECAVAJ22 - ...
CAVAKCAVANQ23 - ...
CAVARCAZ24 - ...
CCAE52 - ...
CCCECC25 - ...
CECECELL26 - ...
CELNCENTO27
you see how now it is in order?
adam