When using the Kotlin Multiplatform Gradle plugin, the directory layout is slightly different. I had to use the following config to make things work:
val config = AnalyzerConfig.gradle(Language.KOTLIN).main()
.withSources(File("src/jvmMain/kotlin"))
.withClasses(File("build/classes/kotlin/jvm/main"))
This could probably be added as a preset, in addition to the one from the regular Kotlin/JVM plugin.