### Elasticsearch Version

8.11.0

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

MacOS

### Problem Description

When sending a ESQL query with the `enrich` command that involves a policy that does not existing a `NullPointerException` is thrown and shown as error messages to the user:

Query:
```
row a  = 1| enrich missing-policy
```

Returns:
```
null_pointer_exception - Cannot invoke "org.elasticsearch.xpack.core.enrich.EnrichPolicy.getMatchField()" because "policy" is null
```

### Steps to Reproduce

See above.

### Logs (if relevant)

_No response_
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Analyzer.java
) {
            Attribute mappedField = fieldMap.get(enrichFieldName);
            if (mappedField == null) {
                String msg = "Enrich field [" + enrichFieldName + "] not found in enrich policy [" + policyName + "]";
                List<String> similar = StringUtils.findSimilar(enrichFieldName, fieldMap.keySet());
                if (CollectionUtils.isEmpty(similar) == false) {
                    msg += ", did you mean " + (similar.size() == 1 ? "[" + similar.get(0) + "]" : "any of " + similar) + "?";
                }
                return new UnresolvedAttribute(source, enrichFieldName, null, msg);
            } else {
                return new ReferenceAttribute(source, enrichFieldName, mappedField.dataType(), null, Nullability.TRUE, null, false);
            }
        }
    }
    private static class ResolveRefs extends BaseAnalyzerRule {
        @Override
        protected LogicalPlan doRule(LogicalPlan plan) {
            final List<Attribute> childrenOutput = new ArrayList<>();
            for (LogicalPlan child : plan.children()) {
                var output = child.output();
                childrenOutput.addAll(output);
            }
            if (plan instanceof Drop d) {
                return resolveDrop(d, childrenOutput);
            }
            if (plan instanceof Rename r) {
                return resolveRename(r, childrenOutput);
            }
            if (plan instanceof Keep p) {
                return resolveKeep(p, childrenOutput);