Getting `Query contains too many nested clauses; maxClauseCount is set to 252061` in ES8

Hi,

We are migrating from ES7 to ES8 and while running a query on ES7 and ES8 respectively, I am getting Query contains too many nested clauses; maxClauseCount is set to 252061 error in ES8 while it is working in ES7.
Can someone please tell what could be the probable cause for the same.

Unable to share the query here, since it is too big.

However the setting is
image

Not sure why it is saying "maxClauseCount is set to 252061".

Having the same issue exactly