Unfortunately, the Microsoft Store does not typically allow refunds for gift cards or codes that are lost or missing their code. Once a gift card is purchased, it is generally considered non-refundable. In your case, since the code is missing and the receipt has been discarded, it may be challenging to retrieve the value of the card or get a refund.
You might want to contact Xbox Support directly to explain your situation. They may have specific procedures for handling such cases, but there is no guarantee of a refund or replacement without the code or receipt.
References: