Sometimes inventory panel is slow to update.. Could that be it for you? Or (I think) some military mission cargoes don't show up as cargo items??
Going back to by first suggeston, One situation springs to mind... It was precipitated by an incident a few months ago, I had an embarrassing episode where I'd done a courier mission in my Vulture and (as doing the run home 'empty' makes no profit, and I do have a small cargo rack in it). I stocked up in a commodity that would turn a tidy profit back at base and flew home. Got home tired, restock etc... Bed...
Next day I went bounty hunting - dropped into the res zone, Prior to getting stuck in, was just tinkering in one of the UIs when I was unexpectedly attacked by multiple (three?/Four?) pirates. By the time I got myself together and into the fight, it was too late... It turns out in my tiredness the previous evening, I'd forgotten to sell the cargo that I'd bougt back...
So now if go bounty hunting, I check the hold as I leave the station, just to make sure that I've not painted a big unnecessary target on my hull....
Cue last week. I left the station to go bounty hunting. Checked the hold - Cargo - oh *!!! , request docking, land, check hold - nothing. Thought it through, and yes, I'd sold the cargo, but the inventory panel had just been slow updating. I'd just re-docked for no reason!
(Corrected struck out comment above - the situation I was thinking about, transfers military cargo to you automatically -you don't do it yourself. - and hence does not fit your situation . I was getting confused)