$query = $queryOne->unionAll($queryTwo)->order(['Headers.id' => 'desc']);
this is not working.
$query = $queryOne->unionAll($queryTwo)->order(['Headers.id' => 'desc']);
this is not working.
You can try making View in Mysql to sort after UNION.
Otherwise there is no way to do that in Cake structure.