That can happen in Scala as well because of shared binaries, as is reported in this thread.
With Scala 2.13/Scala 3 they both compile down to an intermediate format called TASTy which allows binary code to be shared. You don’t get the same binary incompatibilities you do with other languages.