Sort a Joined List using a secondary joined list as sort keys

sure. I’ll PM you an email address.

The issue here turned out to be an edge case that the code column did not handle correctly.

By default, the code column will return the original list, sorted by the keys array in descending order.
If you specify an ascending sort, this is achieved by simply reversing the array after it’s been sorted.
The problem with that was if you had two or more keys with the same value, this would cause their original order to be reversed. So instead of coming back in sheet order, they would come back in reverse sheet order. Which was not the desired behaviour.

So the fix was a minor adjustment to the code column, to ensure that sheet order is preserved when two or more keys have the same value.