Booleans are supported in SQL only starting with 23c. In an earlier release, the following function, when selected in an SQL statement, throws an ORA-00902:
create or replace function tq84_bool
return boolean
as
return true;
end tq84_bool;
/
select tq84_bool from dual;