The problem is fill(). See this paragraph in the docs
Every location of the returned array is set to (and is thus === to) the value that was passed; this means that if the value is itself modified, all
elements of the filled array will reflect that modification because they’re still that very value. This is of no concern with fill(1.0, (5,5)) as
the value 1.0 is immutable and cannot itself be modified, but can be unexpected with mutable values like — most commonly — arrays. For example, fill([], 3) places the very same empty array in all three locations of the returned vector: