Trying Igor's suggestion about switching classloader to project.getClassRealm().
Adding some log to clearly see what ClassRealms exist at this point.