You're tracking a total amount of dust found, but you're returning it before every slot has been checked (or if a slot is the wrong item, returning 0).
First item in the backpack is a rock.
Not reagent item. Next!
Second item in the backpack is a reagent item.
int total = 0 + stack size.
Return total! All done!
(Hey...what about the 3rd, 4th, and 5th items?)