This might be an issue with v1.7.9? See below. You can test this on a blank DB.
USING VERSION 1.7.8 (STABLE):
orientdb {tempdel002}> select expand( $c ) LET $a = (select from #5:2), $b = (select from #5:2), $c = UNIONALL($a,$b)
----+----+------+-------------------------------------------------------------------------+------+-----
# |@RID|name |password |status|roles
----+----+------+-------------------------------------------------------------------------+------+-----
0 |#5:2|writer|{SHA-256}B93006774CBDD4B299389A03AC3D88C3A76B460D538795BC12718011A909FBA5|ACTIVE|[1]
1 |#5:2|writer|{SHA-256}B93006774CBDD4B299389A03AC3D88C3A76B460D538795BC12718011A909FBA5|ACTIVE|[1]
----+----+------+-------------------------------------------------------------------------+------+-----
2 item(s) found. Query executed in 0.003 sec(s).
USING FRESH, BLANK DB ON VERSION 1.7.9-SNAPSHOT
orientdb {tempdel02}> select from OUser
----+----+------+-------------------------------------------------------------------------+------+-----
# |@RID|name |password |status|roles
----+----+------+-------------------------------------------------------------------------+------+-----
0 |#5:0|admin |{SHA-256}8C6976E5B5410415BDE908BD4DEE15DFB167A9C873FC4BB8A81F6F2AB448A918|ACTIVE|[1]
1 |#5:1|reader|{SHA-256}3D0941964AA3EBDCB00CCEF58B1BB399F9F898465E9886D5AEC7F31090A0FB30|ACTIVE|[1]
2 |#5:2|writer|{SHA-256}B93006774CBDD4B299389A03AC3D88C3A76B460D538795BC12718011A909FBA5|ACTIVE|[1]
----+----+------+-------------------------------------------------------------------------+------+-----
3 item(s) found. Query executed in 0.006 sec(s).
orientdb {tempdel02}> select expand( $c ) LET $a = (select from #5:2), $b = (select from #5:2), $c = UNIONALL($a,$b)
0 item(s) found. Query executed in 0.001 sec(s).
orientdb {tempdel02}>