Velo Code doesn't work on mobile version

Hi everyone!
We wrote a custom Velo script that should redirect users to an external payment page right after they complete the Wix registration form.

On desktop everything works perfectly — after registration the user is redirected to the correct external link.
But on mobile, the redirect simply doesn’t happen: the sign-up window closes, and the user is returned to the same page they were on before registration. No new tab, no redirect, nothing. It sometimes works 1 out of 10 times with a long delay, but usually fails.

We’re trying to understand whether our code contains an error, or whether Wix imposes some kind of limitation for mobile redirects from the registration form.

We also saw comments online saying that mobile and desktop versions need to be handled separately in the code, but couldn’t find any official documentation or examples of how to do that in Wix/Velo.

If someone can take a look at our code and tell us what’s wrong — that would be amazing.
One more detail: our website has two language versions, so we use two different redirect URLs (you can see both in the screenshot).

Thank you!