While not everyone does it to us we tend to either keep the receipt if it's a gift card for a close family member (in which case there's no embarrassment about asking because we all would want to know) or we tape the receipt to the gift card.
Gift cards don't always have to be purchased by a cashier, you can do them in self-check out depending on the store, gift card and amount so it's possible to be user error too at times. Also while not wise you can also purchase gift cards 3rd party sites. Some people also go through gift cards at the store, write down the numbers and then wait for it to be activated so they can steal the balance on it/use it. Any of these seem possible to me.