I just had two staves of perception in my inventory,
one identified and down to 0 charges, the other one
without knowledge of the counter. When I used the
second to identify itself (which revealed 18 charges),
the two were reordered, and the wrong one decremented,
which leaves me now with two staves with 18 and -1
Savefile is available, although I guess it won't be of
much help here.