It's rather well-known behaviour. I'm not saying it's not somewhat unexpected.
The thing is that SQL Server tries to bind names to objects as one of first things id does with the query. With a subquery, it tries to bind columns to tables in the subquery first; if it don't succeed, it will bind columns to tables in outer query.
It's actually an excellent reason to always use aliases with tables.