I am pretty sure the Sam's Club Mastercard, similar to the BJ's credit card does not earn any cashback on gift cards. Because Sam's and BJ's know what you are purchasing they can filter out gift card purchases for cashback.
Here is the specific exclusion from the Sam's club CC website:
You can find this verbiage on their website:
https://www.samsclub.com/content/credit
Just an FYI for future, you should use another credit card that earns cashback instead of your Sam's Club CC when purchasing gift cards from Sam's (same holds true for BJs).