Using the same package name for mixed JVM web application (Java + Kotlin) throws Type exception

When using Java and Kotlin together, using the same package name (but different folders src/main/java or src/main/kotlin), compileJava throws error for the Kotlin compiled classes.

if we change the package name, it works perfectly.

Is it normal or any known work around available?

Please let me know if you need any other information thanks