The issue is reproduced with JvmLegacyTransformationTest.testClasspath for Kotlin 1.8.20+.
Both original and transformed classes stay in the test compile/runtime classpath, though just transformed classes should be there.
This is the issue only for JVM projects that use legacy bytecode transformation.