I suppose the problem is related to Groovy type system support.
When using Gradle Java plugin I always have a warning highlight in IDE on JAR manifest configuration:
'manifest' in 'org.gradle.api.tasks.bundling.Jar' cannot be applied to '(groovy.lang.Closure)'
However, corresponding method exists (https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/bundling/Jar.html#manifest-groovy.lang.Closure-) and the script compiles successfully.
I observe this behavior for a pretty long time, so I'm sorry if the issue is already known. Quick search on the forum gave me only 2006 year related report: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206903165-False-cannot-be-applied-to-
IntelliJ IDEA 2021.2 (Build #IU-212.4746.92)