The answer is given in the doc string of isearch-forward:
If this function is called non-interactively with a nil NO-RECURSIVE-EDIT,
it does not return to the calling function until the search is done.
See the function isearch-mode for more information.
In your first form
(let ((isearch-filter-predicate (lambda (a b) nil)))