Well, one of the advantages of Kotlin DSL is, that it is type-safe and that you get amazingly better IDE support.
The implementation you try to use there is a configuration. If it does not work without quotes, that means you did not apply and plugin in the plugins { ... } block that adds this configuration. Only things that are added by plugins in the plugins { ... } block without condition hat those type-safe accessors as Gradle is pretty sure they will be available at runtime. If you for example remove that plugin that adds it, compilation of the script already fails, not only at runtime.
My using the quotes you say “I know better than you, it will be available” and instead get a runtime error if it is not found.
That the string-version works is most probably a sign that you either use the legacy way to apply plugins, using apply, it that you use highly discouraged cross-project configuration like allprojects { ... }, subprojects { ... }, project(...) { ... }, or similar, which you all should avoid to use.