App uploaded for dev not working if the page redirects to another domain

Hi, we are working on Jira app which renders on the linked issues panel, and for testing we are uploading the descriptor file url.
The descriptor file has baseUrl defined, as well as urls for configuration page and the linked issues page.

Also, in our code, we are loading this script from Jira -
From this script, we are using this utility to get the user’s locale = “AP.user.getLocale(callbackFunction)”

There are 2 scenarios in our app.
In the first scenario the app renders with the baseUrl as domain and renders a url on that domain.
In this scenario, the app renders fine, and we are able to get the user locale also using “AP.user.getLocale”

In the second scenario, the app renders initially with the baseUrl, but then redirects to a page on another domain different from baseUrl specified in the manifest. Here the page renders, but the iframe remains hidden with opacity and height set at 0. Also, the getLocale function does not work, the callback function is never called.

This leads us to deduce that the issue might be because we are redirecting to a different domain, so after redirection the page is not able to communicate to the parent.
Can anyone please confirm that this is the issue here?

When an app renders in jira, can it only work with the baseUrl specified in the manifest file?
If the page redirects to another page from the manifest then it will not work?
Is there anyway to get this scenario to work?

Please help.