The issue arises because the second rule processes the request after the first one and seems to overwrite the value set by the HTTP_HOST rewrite in the first rule. To make both rules work correctly, you need to ensure the HTTP_HOST value from the first rule persists while applying the second rule.
For more details: https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-configuration-reference https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-configuration-reference#Using_Server_Variables