Pure function calls are not cached in Blueprints, so if it returns an array with 10 entries, then the function would get called 10 times, once for each entry. Essentially redoing the work more than it needs to. It’s a bit of a trap that’s not mentioned anywhere.
By storing it in a variable, it’ll only be called once, instead of recalled on every loop iteration.