yEd supports Java 8 up to and including Java 15. Newer versions of Java are not yet supported.
The reason for the error are behavior incompatible changes from Java 15 to Java 16.
I strongly recommend to install yEd with a bundled Java 15 runtime environment to prevent this kind of problem.
If you want to try out Java 16 or newer nevertheless, you can try running yEd with the virtual machine options from this vmoptions file. No guarantees though.