Most of the time, running the code below from PL/SQL Developer (or any other tool) works fine. An Apex session is created if needed, and a collection is either created or truncated.
Every once in a while however, I get "ORA-02291: Integrity constraint (APEX_230200.WWV_FLOW_COLLECTIONS_FK) violated - parent key not found".
I have seen this on Apex 23.2, so this may a bug that has been fixed since.
Solutions that usually work: database log off / log on, starting a new instance of PL/SQL Developer, or running it using the debugger.