If you’re getting a 524 error from Cloudflare, there’s nothing for you to remove from the cache: The error pretty much says that Cloudflare TRIED to access your origin server to get this URL - which is the opposite of using their cache - so Cloudflare is already not using cache for this URL.
Supposedly, since it’s a search, that the search just takes too much time on your origin server, until Cloudflare times out the request. You could try bypassing Cloudflare, and measure how much time it takes you to run the same query on your original site without Cloudflare involved, and see if the error is warranted (i.e. it takes an unreasonable amount of time; most people agree that waiting more than a few seconds for a page to load makes most of your users leave your site… so consider this.)
It can very well be that one search term returns fast and the other slower, usually due to the volume of the data returned, which grows on many occasions, such as using popular words for your language like “at”, “to”, “for”, or if your query acts as “OR” in a way that it basically collects all results of all words alone and combine them, and you’re search for some “sentence” containing multiple words, of which some may be popular.