The sort function has no reason to ask for all three comparisons.
Rather, it can ask for two comparisons and act according to the results (e.g. it learns that 1 < 2 and 2 < 3 and returns [1, 2, 3]).
This makes the output unspecified in general, but it will be consistent with the information received and the calls made even if the comparator doesn't form an ordering, which is what one would expect.
It is absolutely possible to write a comparator that evaluates things in a circle e.g. 1<2 && 2<3 && 3<1.
At that point it is impossible to "do your best" there is no correct answers only wrong ones. (You have to violate a comparison here)