If you're saying that it switches a bool to true that doesn't exist in the function then it must be elsewhere in the code, or if that was an example and you mean it is switching a different one in the function to true then it could be any number of reasons. We can't see when the function is triggered.
To make it foolproof I would bring the overlap family condition out of the function, and with that call the function, so it is like player overlaps costume, then call costume pick up function, this is more standard. You can send the family UID through the function as a parameter so you know which one was picked, in fact you would have to as things inside functions do not relate to instances picked by conditions outside of them, then use this family instance picked by UID to check its variable and such.