PaaS Server - Random row order while using aggregate function with group by
Without ORDER BY, you tell SQL Server that you don't care about the ordering. 

SQL Server can do GROUP BY and aggregation internally by either sorting data or through hashing. SQL Server decides this based on what it expects to be the more efficient way. For your case when the order isn't consistent, SQL server found it more efficient to use hashing, apparently. You can see this in the execution plan. 

Bottom line is, as always, if you want some specific order for the rows, then you need to use ORDER BY.