Getting this error "because \"namedWriteable\" is null"

Hi All,

Executing below query and getting this error:

Error:
“type”: “null_pointer_exception”,
“reason”: “Cannot invoke "org.opensearch.common.io.stream.NamedWriteable.getWriteableName()" because "namedWriteable" is null”

Query:
{
“aggs”: {“time_series”: {
“date_histogram”: {
“fixed_interval”: “1d”,
“field”: “@timestamp
},
“aggs”: {“diff_terms”: {
“multi_terms”: {
“size”: 20000000,
“terms”: [
{“field”: “tag.process_name.keyword”},
{“field”: “tag.env.keyword”},
{“field”: “tag.status.keyword”},
{“field”: “tag.endpoint.keyword”}
]
},
“aggs”: {“d_count”: {“sum”: {“field”: “cai_process.total_count”}}}
}}
}}
}

Same query works on ElasticSearch 7.15 but getting error in OpenSearch 2.1.0. Please help.

If I use terms aggregation instead of multi_terms, I don’t get the error.