BUG: fix uninitialized-use on invalid sort kind

can probably only be triggered by using the C-api wrong