Distinct does not know that you ordered your items before they were received, so he cannot use this knowledge. Thus, he must assume that the elements are disordered and thus simply do what they want with them.
A typical implementation will use a hash table that is not ordered by what you usually want the elements to be ordered, so the result of a single operation is unordered.
As others have suggested, reorder your calls to make the order last, and you should get what you want.
source share