I'm not really sure if it's a bug or not because it seems like it could very well be working as intended.

If retainers capped on gil and you sell something on MB, the item will still sell and the gil just disappears since you're capped. Nothing prevents it from being sold, you just lose your items & the gil.

Likewise, if you're doing retainer ventures for shards and you're shard capped and don't notice it, you'll still "receive" the shards from the ventures, but since you're capped they'll just disappear.

Some sort of warning dialogue or something preventing your items from being sold if market value is set above what your retainer can potentially store would be great.