If this relic was in a garage sale, it is reasonable to assume it could be bought by someone who would desecrate it. In that case, it is allowed and advisable to buy that relic. And yes, a third class relic is as you describe, and also many are “sold,” but it is truly the holder that is sold. Fir instance, a crucifix that has a relic encased can be bought/sold without committing a sin because you are only giving/receiving the value of the crucifix.
We do have a duty to protect holy objects from harm, and the fact that this was in a garage sale shows you needed to protect it. If you are concerned, please talk to your confessor