First and last will work, middle not.
forEach takes each element inside the given array. You are using the units command, which need a group on the right side and returns an array. The brackets in the third line are not needed. But in the second line the units command gets an array with one element being the group. That is not allowed.