Gradle before 4.10 was not able to run on Java 11.
Right now the default behavior is to work with the project provided wrapper if that is available.
So in case NetBeans is running on Java 11, but the Gradle Wrapper uses Gradle before 4.10 then the project cannot be loaded in NetBeans.
Right now there are two workarounds: Use NetBeans with some older Java or disable the "Prefer to use Gradle Wrapper that Comes with the Project" Setting in Tools > Options > Java > Gradle tab
The preferred way of handling this situation is when the Gradle Project Wrapper is not compatible with the JDK, then use the Gradle tooling that comes with the IDE.
The IDE might display a notification on this when encounters with this problem.