Wrong location assigned for an order placed with custom app with admin API

My store uses a custom checkout that places orders with REST Admin APIs instead of shopify native checkout.
An order was placed with a product that has 3 locations as shown in the below image.

As it can be seen the stock for the product is available only in location “Noida warehouse”.
But when the order is placed, the order is assigned to location “#371”. Where stock is not available.

My custom app takes care of inventory updation,so the inventory is getting updated in the correct location(Noida warehouse),but still location is assigned to “#371”.
I have changed the default location to “Noida Warehouse” in the settings,But it is always getting assigned to location “#371”.
If the same order is placed through shopify native checkout,The location is getting updated correctly to “Noida warehouse”.
What is the problem with the custom app approach?