That may or may not be true depending on your version. Prior to 9.3 you might need to set the Rechunking option in the HTTP profile, but that shouldn't be the case anymore with STREAM expressions.
https://support.f5.com/kb/en-us/solutions/public/6000/400/sol6422.html
So what it looks like you're trying to do is replace all instances of the HTTP URL with HTTPS. The stream profile will look at payload. You can set the Redirect setting in the HTTP profile to either ALL or MATCHING to get the BIG-IP to replace HTTP references in 30x redirects. Otherwise, you still need to compare the request and response traffic between the working and non-working environments. My guess is that you're either not catching something in your iRule, or some other value is slipping through/changing that the application can't use.