Sort Node Queries by an entity reference field within a field collection item
Solved it myself. I added one more join, 

$query-&gt;join('taxonomy_term_data', 'fee', 'cfs.field_subject_target_id = fee.tid'); 

Then order by 

$query-&gt;orderBy('fee.name', 'ASC');


Then the result was ordered alphabetically by the taxonomy name.