TEIID-4629 it is possible to interleave the definition of schema elements, which is not accounted for by the loading order - and will fail upon later validation/resolving.
create virtual schema first;
create virtual schema second;
set schema second;
create view x ...;
set schema first;
create view y as select * from x;
the last statement will fail later as we'll try to resolve the schemas in order.
A similar issue exists with create domain -