Scala substring(i, outOfBoundsNum) sometimes ok in Fiddle, but not in production code?

I noticed that this:

val word = "My word"

Works just fine in a Scala Fiddle: here

But it throws an ArrayIndexOutOfBounds exception when running in production. Why is this allowed in the Fiddle, is it a Scala versioning? I'm testing this in Scala 2.12 for my production code.