CreateInInventory method doesn't work as expected in cases when cargo contains an item with another restricted cargo (e.g. empty backpack / jeans / t-shirt, etc inside another backpack). Please see the screenshots. For the full demonstration, I've created items with cargo size 1x1 (12ga Rifled Slugs)
As on the screenshot with a Frying Pan CreateInInventory method will create bullets inside the pan until it's full. After that, the method will start to create bullets inside the bag. That's okay, that's how it should work.
In the second screenshot, I replace a frying pan with jeans. CreateInInventory will create the bullets until the t-shirt is full. Another attempt to call this method will return a null and an object won't be created.
The third screenshot is a demonstration of the player's inventory when CreateInInventory starts to return null