### Elasticsearch Version

8.11.0

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

MacOS

### Problem Description

I would expect a clear message for the following ES|QL query:

```
from index | where 1 year
```

But what I get is:

```
[esql] > Unexpected error from Elasticsearch: illegal_argument_exception - Unrecognized class type class java.time.Period
```

### Steps to Reproduce

See above.

### Logs (if relevant)

_No response_
x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java
error("from test | stats length(first_name), count(1) by first_name")
        );
        assertEquals(
            "1:19: aggregate function's field must be an attribute or literal; found [emp_no / 2] of type [Div]",
            error("from test | stats x = avg(emp_no / 2) by emp_no")
        );
        assertEquals(
            "1:25: argument of [avg(first_name)] must be [numeric], found value [first_name] type [keyword]",
            error("from test | stats count(avg(first_name)) by first_name")
        );
        assertEquals(
            "1:19: aggregate function's field must be an attribute or literal; found [length(first_name)] of type [Length]",
            error("from test | stats count(length(first_name)) by first_name")
        );
        assertEquals(
            "1:23: expected an aggregate function or group but got [emp_no + avg(emp_no)] of type [Add]",
            error("from test | stats x = emp_no + avg(emp_no) by emp_no")
        );
        assertEquals(
            "1:23: second argument of [percentile(languages, languages)] must be a constant, received [languages]",
            error("from test | stats x = percentile(languages, languages) by emp_no")
        );
        assertEquals(
            "1:23: second argument of [count_distinct(languages, languages)] must be a constant, received [languages]",
            error("from test | stats x = count_distinct(languages, languages) by emp_no")
        );
    }
    public void testDoubleRenamingField() {
        assertEquals(
            "1:44: Column [emp_no] renamed to [r1] and is no longer available [emp_no as r3]",