It is not possible, the IMAP protocol does not have such functionality.
This is what RFC 9051 says:
SUBJECT <string>
Messages that contain the specified string in the envelope structure's SUBJECT field.
The suggested way is to fetch all the messages with the given search criteria and then filter out unwanted messages locally (at the client).