It only works if the messages are seen as authenticated.
the Address Rewrite Outbound agent will work only when the sender’s SMTP address is internal, and the session is authenticated
You can force Exchange to treat the message as submitted from an authenticated source by creating a Receive Connector with the “ExternalAuthoritative” Authentication mechanism. Make sure you only have the IP address of the application or third-party source under the remote IP Address range in this receive connector. This is important, since when you select ExternalAuthoritative for authentication, you’re telling Exchange to completely trust the IP address(es) or subnets specified in the RemoteIPRanges parameter of that connector, allowing those IP addresses to relay through your server. You can run the below commands to create a connector with ExternalAuthoritative Authentication enabled: