Hmm... I'd think that the problem is with the `distinct` expression (which is adding external constraints to other expressions), in the sense that you can remove the `distinct` expression without touching the `order_by`, and the query would be valid. So from a philosophical standpoint, the `order_by` must have been intrinsically correct!

Oh yeah, I have no idea what I am talking about.