Indeed for NetBeans this codepath should not be hit. If permissions were somehow messed with though, the file might indeed be unreadable and thus explain why the "load from classpath" route is taken.
Avoid use of types that are deprecated as of Java 26. Include ASM 9.9 that offers ASM support for Java 26. Make sure that generated code internal to Byte Buddy supports CDS if available. Update ...