A modular Java project describes its dependencies twice. The build script says which artifacts to download and put on a path. module-info.java says which modules this one requires. Nothing forces the two lists to match, and they drift.
The failure modes are not symmetric. A module in requires that the build never supplies fails at compile time with a clear message. A JAR the build supplies that no requires mentions is simply not readable from your module, and the compiler says so. The confusing case is a dependency with no module-info.class. On the module path it becomes an automatic module, named from its Automatic-Module-Name manifest entry if it has one and derived from the JAR filename if it doesn't. Rename the file and the name your requires line points at can change.
Put the same JAR on the class path and it lands in the unnamed module, which a named module can't depend on at all.
So the build script is my source of truth for what exists, and module-info.java is a statement of what I'm allowed to touch. Different jobs. Does anyone actually check one against the other without a plugin?