union only dispalying the first query
By default UNION - merge distinct values (https://www.postgresql.org/docs/10/static/queries-union.html) so if your quarter values same(and looking for code - it is exactly) - one of the results would be omitted.

Use UNION ALL if need keep all results