Search API return messages that has been edited and so does not contains the search term anymore. First work for this issue is to describe it a bit more, with step to reproduce, and check how Element Web is handling that. See https://github.com/matrix-org/synapse/issues/8686