An ESQL expression can only have at most 5 CAST operations for a particular data type.
Rewrite your ESQL expressions so that they do not have more than the maximum number of CAST operations.