A lot depends on what you need.
An item can be in a chest on the ground. Who owns it?
An item can be in a bag on the ground and then that bag picked up by the player. Who owns it?
When is “ownership” actually needed and what for?
InContainer is very clear (and can even have container position as part of it if there is never a reason to separate them). It does just the aspect it says: “this entity is inside this other entity”. Whether the container is a chest on the ground, a bag being carried, or the player’s hand just depends on how you want to model things. (I think my first approach had inventory slots: left hand, right hand, back, belt, etc. to which items could be attached… and those items could be containers. So ‘inventory’ and ‘containers’ were separate.)
If you need to find out “what player is holding this arrowhead” then that seems like a relatively rare request and it’s probably ok to see that it’s in a small silver box inside of a bag inside of the player’s backpack.
For me, it was only during transitions that I cared about this stuff. And there is almost a transactional quality to it because you don’t want the InContainer to get removed and the world Position not to get set when something is dropped on the ground. You have to make sure to always do them both together. I struggled with several ways to do that when I’m running “take” and “drop” scripts and have to sort that out through container hierarchies and stuff. (Example I used was a cursed item that the player is not allowed to drop.)
…in the end, I cleaned up a lot of problems by leaning into the ES ideas and using a MoveTo component. A separate system would handle the script mechanics and kept multiple systems from trying to write the same components. (The ‘cursed item’ thing is still tricky as you need ‘CanDrop’ handlers and such.)
I don’t know what the best solution or if I will think of something better for the new engine but that’s essentially where I ended up last time I played with this.
Looks like that was almost 7 years ago, though.