This query has both a UNION clause and an ORDER BY clause. In a union query, in which multiple SELECT statements exist and the names of the selected columns in each statement are not necessarily the same, you cannot use column names or expressions in the ORDER BY clause.
Instead, you must use column position numbers, with 1 representing the first selected column, 2 representing the second, and so on. Rewrite the query to use only numbers in the ORDER BY clause.