Think I already found the answer. The local deployment uses HSQLDB and the public sandbox is a Postgresql db:
But more specifically it seems to be an issue with differences in collation between the two. Because I’m running locally on a windows machine and the cloud node is most likely a unix system, they probably have different collations, which can lead to different sorting results, even if the same DB is used (e.g. Postgresql):
I’m going to try and see if I can do a retrieve and then use the “List Sort” activity to get the same sort result across both locally and sandbox deploys.
Yes, the List Sort action solved this for me. Most likely because it’s using Java to do the sorting vs. the underlying DB.