Old bug since at least Origin 6.1
When sorting worksheet based on a column with many duplicate values, the sorting order in other columns may not follow the appearance order.
See column B’s result. Origin 2023 follows the appearance order. Earlier version shows those values in random order.
System variable added @WSA=1 (default). Set it to 0 to roll back to old behavior.