The following query

```
row  a = \"a\", b = 1 | stats  e = min(b) by a | dissect a \"%{e}\" | mv_expand e
```


throws an IndexOutOfBoundsException when building the layout for MV_EXPAND.


x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/Layout.java
* Appends many new channels to the layout. Each channel is mapped to a single attribute id.
         */
        public Builder append(Collection<? extends NamedExpression> attributes) {
            for (NamedExpression attribute : attributes) {
                append(new ChannelSet(Set.of(attribute.id()), attribute.dataType()));
            }
            return this;
        }
        /**
         * Build a new {@link Layout}.
         */
        public Layout build() {
            Map<NameId, ChannelAndType> layout = new HashMap<>();
            int numberOfChannels = 0;
            for (ChannelSet set : channels) {
                int channel = numberOfChannels++;
                for (NameId id : set.nameIds) {
                    ChannelAndType next = new ChannelAndType(channel, set.type);
                    ChannelAndType prev = layout.put(id, next);
                    
                    
                    
                    
                }
            }
            return new DefaultLayout(Collections.unmodifiableMap(layout), numberOfChannels);
        }
    }
}