Logout always redirects to first url from Allowed Logout URLs

I have a React application, and whenever I do logout, it always redirects to first URL from “Allowed Logout URLs” even though, I have specified the returnTo in my provider.

Here’s the code for my provider:

            domain="<My domain here>"
            clientId="<My clientId here>"
                redirect_uri: window.location.origin + window.location.pathname,
                audience: '<My audience here>',
                scope: 'openid profile email',
                returnTo: 'http://localhost:3000/login',

So, let’s say my application is https://test.com (just an example). I have mentioned “https://localhost:3000/login, https://test.com/login” in the “Allowed Logout URLs” list. I have also mentioned them on the advanced settings on my Tenant level.

Still, whenever I do logout on https://test.com, it redirects me to “https://localhost:3000/login” since thats the first URL in the list.

How to redirect users to “https://test.com/login” instead of the localhost?