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
/**
     * The values stored in the {@link Layout}, a channel id and a {@link DataType}.
     */
    record ChannelAndType(int channel, DataType type) {}
    /**
     * A part of an "inverse" layout, a {@link Set} or {@link NameId}s and a {@link DataType}.
     */
    record ChannelSet(Set<NameId> nameIds, DataType type) {}
    /**
     * @param id the attribute id
     * @return the channel to which the specific attribute id is mapped or `null` if the attribute id does not exist in the layout.
     */
    ChannelAndType get(NameId id);
    /**
     * @return the total number of channels in the layout.
     */
    int numberOfChannels();
    /**
     * @return creates a builder to append to this layout.
     */
    Layout.Builder builder();
    /**
     * Build a list whose index is each channel id and who's values are
     * all link {@link NameId}s at that position and their {@link DataType}.
     */