Update By Query fails with 400 - Bad Request - couldn't debug and no details available

Mapping:

 "students": {
          "properties": {
            "_class": {
              "type": "keyword",
              "index": false,
              "doc_values": false
            },
            "id": {
              "type": "keyword"
            },
            "startDate": {
              "type": "date",
              "format": "date_optional_time||epoch_millis"
            }
          }

UpdateByQueryRequest: POST /scene/_update_by_query?slices=auto

{"conflicts":"proceed","query":{"bool":{"filter":[{"terms":{"id":["3ca44d9e-14be-4187-bf38-0bff08981582"]}}},"script":{"params":{"student":"MyStudent(id=4e10fa49-47c3-4cd4-8001-1213825bec7b, startDate=2024-05-16T15:23:20.789Z)"},"lang":"painless","source":"if(ctx._source.students != null) {                 ctx._source.students.add(params.student);           }            else {                 ctx._source.students = new ArrayList();                 ctx._source.students.add(params.student);           }        "}}

Here is my Kotlin class used for the param:

data class SutdentParam(
    val id: UUID,
    val startDate: ZonedDateTime,
)

Also it works, when in my class, have used String instead of ZonedDateTime.

data class SutdentParam(
    val id: UUID,
    val startDate: String,
)

Could you please help me understand what's happening?

The body of the HTTP response will contain details of the problem. It's not really possible to help without seeing that.

Thanks for the reply.
Have tried my best to check the error Response even by debugging.
I'm not getting many details other than saying 400 - Bad Request.

Please find here the stack trace:

Caused by: co.elastic.clients.transport.TransportException: [es/update_by_query] Failed to decode error response
	at co.elastic.clients.transport.rest_client.RestClientTransport.getHighLevelResponse(RestClientTransport.java:291) ~[elasticsearch-java-8.5.3.jar:na]
	at co.elastic.clients.transport.rest_client.RestClientTransport.performRequest(RestClientTransport.java:148) ~[elasticsearch-java-8.5.3.jar:na]
	at co.elastic.clients.elasticsearch.ElasticsearchClient.updateByQuery(ElasticsearchClient.java:1788) ~[elasticsearch-java-8.5.3.jar:na]

That's not the complete error, and the rest of it contains the details you need to look at.

Also see these docs for information about tracing individual requests.

Could you please point me to an example spring boot Elasticsearch client app that does this configuration?

Have tried different stuffs but still not succeeded in flushing out the Restclient logs except 400 - Bad request.

I can't, sorry, you might need to ask the Spring Boot folks for help with that.