Yeah, that's intended behavior in general, but it's true they shouldn't be in those particular places! In Storage/etc this won't happen because you can't see inside until you actually open a hole, which will allow the item to be pushed out.
But for those particular special branch prefabs which have transparent containers like that and carry an AA/special item, definitely some that should be avoided, thanks.
(Well... now that I think about it you could technically destroy an item in Storage/etc by learning about a trap via non-visual means, but in that case they're not such vital items anyway.)