something similar happened to me recently, only for me I had 1 remaining potion in my possession I was saving for the big "oh-shi.." times... a potion of Cure Critical Wounds. I got nailed with a confusion effect by an umber hulk, and despite only being Barely Injured, my toon went and drank it like I was in danger of dying in another hit. It was inconvenient, but I accept it as a necessary evil.
I don't think the AI should do such things when your in control of the PC, but if your mind is not your own (confused/charmed) then it is a perfectly acceptable risk you take carrying it around. What might be worth considering is making sure the AI doesn't try to use items in storage, which would give us a means of preventing scrolls we want to learn later from getting used.