CC sorts custom integer and float columns as numbers.
Composite columns are always text, the result of evaluating a template, and that is how CC sorts them. CC does not take the calibre "sort hint" into account. If you want a "id" composite column to sort like a number in CC then you must fill it with leading zeros using something like