When sorting a lookup column in the Project Gantt, the lookup ID was used instead of the visible display value. This means that the sorting was done by the internal ID, which is not visible to users, instead of the value that users actually see.
This bug has been fixed: The sorting has been corrected so that the visible display value is now used.