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/LocalExecutionPlanner.java
return source.with(new FilterOperatorFactory(toEvaluator(filter.condition(), source.layout)), source.layout);
    }
    private PhysicalOperation planLimit(LimitExec limit, LocalExecutionPlannerContext context) {
        PhysicalOperation source = plan(limit.child(), context);
        return source.with(new Factory((Integer) limit.limit().fold()), source.layout);
    }
    private PhysicalOperation planMvExpand(MvExpandExec mvExpandExec, LocalExecutionPlannerContext context) {
        PhysicalOperation source = plan(mvExpandExec.child(), context);
        List<Attribute> childOutput = mvExpandExec.child().output();
        int blockSize = 5000;
        Layout.Builder layout = new Layout.Builder();
        List<Layout.ChannelSet> inverse = source.layout.inverse();
        var expandedName = mvExpandExec.expanded().name();
        for (int index = 0; index < inverse.size(); index++) {
            if (childOutput.get(index).name().equals(expandedName)) {
                layout.append(mvExpandExec.expanded());
            } else {
                layout.append(inverse.get(index));
            }
        }
        return source.with(
            new MvExpandOperator.Factory(source.layout.get(mvExpandExec.target().id()).channel(), blockSize),
            layout.build()
        );
    }
    /**
     * Immutable physical operation.
     */
    public static class PhysicalOperation implements Describable {