Where were you in 2014?
viewtopic.php?p=113769#p113769
You are both mistaken in believing that 128 returns the index of the
checked item. Read the documentation with my emphasis added:
128 = Return selected index (first item = "1"). If nothing is selected, "0" (zero) is returned.
It cannot be meaningfully combined with checkboxes (2) because checked is not the same as selected.
Trying checking all items in the list and then Ctrl+Clicking the focused item to unselect it and you'll get back an index of 0, or use Ctrl+Up/Down to move focus to an unchecked item.
Should there be a difference between checked and selected here?
Don seemed to think so in 2014, but I disagreed since I doubt anyone comprehends 128 to literally mean the selected item regardless of checks.
Unfortunately, It's been this way since introduction so changing could break scripts.
However, the combination of the two flags has been discouraged nearly as long, and I would be surprised if anyone relied on the actual existing behavior of 2+128 ignoring checkboxes, so I feel it is probably okay to make 128 returns the selected/checked index(es).
EDIT: While we're at it, 2+16 should probably return the original list in the new order with the checked items prefixed by the preselect character(s).
Ideally, 2+16+128 would do the same but return the original indexes instead, but that's getting ugly so maybe just leaving the "Cannot be meaningfully combined" note there for 16+128 is okay.