API error trying to create return with cancelled items on order

I am trying to create return through the GraphQL API. The only thing different about this order is 2 of the 4 items have been cancelled. When I try and create a return with one of the good items, I get the following error:

{“errors”:[{“message”:“Invalid Line item 534944306, warehouse Primary. It must belong to the same warehouse 11932, [NAME REDADCTED].”,“operation”:“return_create”,“field”:“return_create”,“request_id”:“60f1d1d2513219c080991280”,“code”:9}],“data”:{“return_create”:null}}

Is this a known bug?

Hi,
The line item in our data says that the warehouse (for that line item )is Primary, but that sku does not reside in the Primary warehouse.
Have you tried the same thing in the UI? Does it give an error?

I’m sorry for cross posting but I posted this in another thread. This is specifically what I am seeing:

I am seeing this error in the following situation and would love some advice on how to fix it.

I create an order using the API. My warehouse is set to the ID of my custom warehouse, we’ll call it “custom” for now. I add a new item to that order through the UI. When I try and create a return on the order, the item that was added by hand throws the error: “Invalid Line item ######, warehouse Primary. It must belong to the same warehouse ######, custom”

It seems to me, when I add the new item to the order it is defaulting to Primary instead of what warehouse the order is using. I did not see a place to change this so it would be nice to know a solution.

Hello @fairweather!
No problem with that. We will continue on this thread.
Can you share the request ID of one of the last occurrences of this?
Have a nice day!
TomasFD