Custom plugin extension error

I’m working on a custom plugin as a buildSrc project, following this example: Developing Custom Gradle Plugins

When I try that approach, I get this error:

e: /Users/.../MyCustomPlugin.kt: (20, 28): None of the following functions can be called with the arguments supplied: 
public abstract fun <T : Any!> create(p0: Class<TypeVariable(T)!>, p1: String, p2: Class<out TypeVariable(T)!>, vararg p3: Any!): TypeVariable(T) defined in org.gradle.api.plugins.ExtensionContainer
public abstract fun <T : Any!> create(p0: String, p1: Class<TypeVariable(T)!>, vararg p2: Any!): TypeVariable(T) defined in org.gradle.api.plugins.ExtensionContainer
public abstract fun <T : Any!> create(p0: TypeOf<TypeVariable(T)!>, p1: String, p2: Class<out TypeVariable(T)!>, vararg p3: Any!): TypeVariable(T) defined in org.gradle.api.plugins.ExtensionContainer

which is in line with what I found here: ExtensionContainer (Gradle API 7.1.1)

I tried things like project.extensions.create<MyPluginOptionExtension>("myPluginOptions", MyPluginOptionExtension::class.java, 1), but same error.

Question is: how can I fix this?