The sorting seems to rely on the correct ordering of the columns from the DB/YAML - the current order does not match the displayed order, so if you select to sort by CCODE, we actually sort by callnumber
I don't recreate, can you provide more details please? http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4 Click "Collection" => http://localhost:8081/api/v1/biblios/4/items?&_page=1&_per_page=20&_match=contains&_order_by=%2Bme.collection_code