If a member has balance credits but when you cancel the membership the refund amount shows 0 (zero), check whether it is a non-recurring membership. You can refund the membership, if the Excess Refund setting is enabled.
To enable excess refund:
You must have the necessary permissions to do this.
At the organization level, click the Admin icon and navigate to Organization > Security Roles.
In the Name column, click the role for which you want to enable the permission.
Go to the Permissions tab.
Expand the Marketing Manager section.
Under Memberships, select the Excess refund setting.