Sorting is done on the Key and depends on the database and the applied locale for sorting.
You probably used non-alphanumeric codes like underscores. Did you use a HSQL/Builtin database locally and postgres on the cloud?
If sorting on enums is important in the GUI, I sometimes set them up like this:
They are sorted on the Name, but display the Caption. I have not tested sorting in a microflow, but I suspect the sort is also on the Name