This appears to be related to Java.
I would recommend checking that you have a correct version of Java installed for your Apple Silicon machine;
Also, if you were to upgrade to R2025a or R2025b, they both reduce the reliance on Java a fair bit.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!