When subqueries are made they link to their parent queries _queryComponents, then when a subquery has the same $componentAlias as was used in the parent query it can over write its properties.
Quite specifically the problem happens when a subquery references a parent table in its select, causing the compentAlias in the parent query to be overwrite with information from the subquery.
When subqueries are made they link to their parent queries _queryComponents, then when a subquery has the same $componentAlias as was used in the parent query it can over write its properties.
Quite specifically the problem happens when a subquery references a parent table in its select, causing the compentAlias in the parent query to be overwrite with information from the subquery.