It seems that your Xbox account is set to use gift card balances for payments before charging your credit card, which is a common practice. This means that if you have a remaining balance on your gift card, it will be used first for purchases, including subscriptions like Xbox Game Pass. If you prefer to use your credit card instead, you may need to adjust your payment settings in your account.
For a refund, you can follow the steps provided by Microsoft to request a refund for any charges made. Typically, refunds can be requested through your account's orders page. Make sure to check the eligibility criteria for refunds as well.
References: