I also have checked what you say and it doesn't work.
I propose a solution that it works but i don't know if this will be helpful for you. Creating an extra numeric field in the script that represents the order alphabetically. For example if you have three Countries like USA, France and Germany. You will have that:
Country - Numeric Field
France -> 1
Germany -> 2
USA -> 3
Obtain this numeric value can easily be done in the script.
Then if instead of using the Country in the sorting seettings, you use the Numeric value field it's working correctly for me.
Thank you Jaume, this is a helpful hint, however does not work in a generic way. Lets imagine a table (not calling it dimension) where there are countries and next column is continent. I assume I'd need to load the table twice and generate RowNo() for countries and continents separately if I want to use sort by country in one visualization and by continent in another. Later on in the script, it might make sense to join those back.
The disappointment in this is that it's a very basic scenario and you need to provide a workaround to force it to work. First of all this is a non-self-service approach, since a business guy won't achieve this in most cases and would moan about the tool.
Thank you though, this is a useful workaround if you are the one who does the modeling in Qlik Sense!