Hello Thomas,
I tried you recommended way but it did not work again. I deleted the attribute then and created it again as value attribute instead of a model attribute, filled the fields manually in DO_PREPARE_OUTPUT and now the sorting works without any manual adaptions of the code. So maybe it was a problem of model attribute.
Best regards,
Markus