Order by bug on SQL Server 2005 vs SQL Server 2012
If you are running on compatibility level of 80 (SQL-Server 2000), then this is the expected behaviour. It was corrected in version 2005.

You can check the Compatibility levels page at MSDN where the differences are listed. In the section "Differences Between Lower Compatibility Levels and Level 90", one of the many items is:


  When binding the column references in the ORDER BY list to the columns defined in the SELECT list, column ambiguities are ignored and
  column prefixes are sometimes ignored. This can cause the result set
  to return in an unexpected order.
  
  For example, an ORDER BY clause with a single two-part column
  (.) that is used as a reference to a column in a
  SELECT list is accepted, but the table alias is ignored. Consider the
  following query.

SELECT c1 = -c1 FROM t_table AS x ORDER BY x.c1

  
  When executed, the column prefix is ignored in the ORDER BY. The sort
  operation does not occur on the specified source column (x.c1) as
  expected; instead it occurs on the derived c1 column that is defined
  in the query. The execution plan for this query shows that the values
  for the derived column are computed first and then the computed values
  are sorted.


which is exactly what you describe.

The easiest workaround is to not use the same alias for one column in the subquery and for another in the main query.