Theme redirects from 127.0.0.1 (local) to web - in checkout

I’m building a custom theme and running it on my computer, in a local dev environment (on 127.0.0.1).

During checkout, after pushing the continue button after entering my address, the theme redirects to the production website (prompting me to create an account there) - and I can’t continue. Account creation is required in our store, and I had created a local account before starting the checkout flow.

Note - if I disable requiring users to create an account to place an order, this issue goes away.

How can I fix this? It’s not possible to test and develop locally without being able to complete the signup flow and create an account.

Here is a short video showing what is happening: https://www.loom.com/share/a3557851d509435591d6a4664e7c7b96

In short, you can’t fix “this”. Shopify does not store customer, products, order data in a database you can host locally. Even when developing locally, your product and collections data is coming from Shopify. So, to test checkout flow (unless you’re using Shopify Plus Multipass checkout), you will get redirected to Shopify’s Checkout using their servers regardless.