No matter which setting is chosen, the sorting remains on the itemtype column. If the item type column is hidden via table settings, it still seems to apply. None of the other columns shows as sorted judging from the small arrow icons on top. Confirmed in 23.05 and 22.11.
./opac-detail.tt ~ l.1806 it's creating default_order_index that is never used later
The problem is that ever since this commit: https://github.com/Koha-Community/Koha/commit/92f6f5b049cc6a45917465f87efa93d51ff81a4a ...the preference OPACHoldingsDefaultSortField is dead. It sets a JavaScript variable based on it in the template, but that variable is not used anywhere anymore. Right now no sorting is defined, meaning the holdings should actually be sorted by the itemnumber from the items table. The claim that it's sorted by itemtype column should be all but coincidental, can you confirm that? I guess the solution is to either remove that preference to not confuse people or to re-create it in a way that any column could be specified, such as copy number, callnumber and so on, setting it as "first column" sucked anyway.
Hm, a sort by itemnumber is less than ideal as it will produce a "wild mix" that is not clear to the user at all. I am updating severity.