it likely is filtering but taking a long time to process due to the complexity of that query
if you are comparing X to a list of 1000 things and formatting 1000 things values before comparing… well that’s quite intensive to do.
rethink how you do the query to simplify the request - possibly bring data forward in the data structure so you don’t need to do a nested advanced filter client side but can instead do a search server side.