Your code appears to be confusing 'PACKAGE_BODY' (dbms_metadata) and 'PACKAGE BODY' (all_source). This may be affecting your logic.
Don't create objects in sys schema, it is not supported.
Don't write queries against sys.obj$, it is not supported.
Don't expect other people to test objects created as SYS.
[Query]: I have a Database Trigger (AFTER CREATE) and I wish to retrieve newly created Stored Procedure's body.
One possible way is :
you can check user_objects table for latest procedure object created using "Create date" and "Time Stamp".
Using Object name from "user_objects" table you can check "user_source" table to get the body of stored procedure created.