I’m not 100% sure that this is related, but I have a similar issue that was solved another way.
We upgraded from Magento 1.5.1 to 18.104.22.168. After the upgrade we noticed that when creating a Credit Memo for an order that it calculated the amount to add back to inventory all wrong. Strangely enough it invoiced the items correctly, it was only on Credit Memos that the quantities got screwed up.
We have a site with bundle products containing multiples of simple items, for example we keep our inventory for Widget A by using a simple item, but sell it in packages of 5 or 25. So we have a Bundle X which contains 5 of Widget A, and Bundle Y which contains 25 of Widget A.
When we would issue a Credit Memo for example for 10 of Bundle Y, which would be 250 of Widget A, the Credit Memo would indicate that the quantity being return to stock was correct, but the actual inventory adjustment would be for 2500 units of Widget A.
The bug (AFAIK this is in fact a bug) is in app/code/core/Mage/CatalogInventory/Model/Observer.php, function refundOrderInventory.
The offending code:
$qty = $parentItem ? ($parentItem->getQty() * $item->getQty()) : $item->getQty();
$qty = $item->getQty();
And this solved the problem for us.