Calculate Refund API : Refund Line Items Cannot Remove More Than The Fulfillable Quantity

We’re seeing an error happen when we attempt to use the calculate refund api. Below is the error:

Refund Line Items Cannot Remove More Than The Fulfillable Quantity.

Do you know what causes this? Does this occur when we try to set the restock_type to cancel on items that aren’t stockable or that have a negative inventory amount?

Below are the past similar questions posted by others:

https://community.shopify.com/post/1398776

https://community.shopify.com/post/1408628