This task sets the flag to Kotlin compiler which is used to build your project, but warning is about Kotlin used by Gradle, not sure that you can set additional compiler flags, but I may be wrong, anyway you cannot configure it this way
I would just ignore it for now, the warning should go away with Gradle 7.6 (it should use Kotlin 1.7k