Searching for emails containing specified text string in body of email messages in MacOS mail
Searching is performed in whole messages but one can do it explicitly as well.
There is drop-down list of options from which one can select 'Entire Message':

There can be several reasons why mail is not found. One of them could be indexing failure on Mac side and another is IMAP settings of mail provider (there can be limit set for number of mails in local machine)