This is working as intended - you have 3 items, 2 of them have 10 charges, 1 has 8 charges.
While I’m all for pooling charges for items like this (lighters, matchbooks etc. - pilot light from lighters and matchbombs aren’t worth and don’t warrant having them waste inventory letters), this is more of a feature request than bug report.
EDIT: Wait, your screenshot shows how it SHOULD work and how it doesn’t, right?
I had 2 bottles of cough syrup (10), used one of them and now I have 2 bottles of cough syrup (9) until I drop one of them.
That would certainly be a bug.