You cannot actually easily buy something for somebody else with the balance. You cannot gift the balance itself. Anything purchased while signed into your account is linked to your Apple Account. The second person would not be able to update any app or re-download any media purchased with a different account. You could maybe be able to use the balance in part purchase of hardware, but I am guessing you would have to purchase the item entirely yourself and then make a private arrangement as to transfer of ownership of the device. In addition, signing in with your account on another person's device to purchase something for them might cause temporary issues with the other person being able to use their account for purchases and updating on their device. --> View and remove your devices that are associated with your Apple Account for purchases - Apple Support
‘When you try to associate a device that was previously associated, you might notice a message that says, “This device is associated with another Apple Account. You cannot associate this device with another Apple Account for [number] days.” You might need to wait up to 90 days to associate the device with a different Apple Account.’
If you have not spent any of the balance and a physical card was involved, have you actually tried doing as I suggested two days ago and call Apple to see if you get the balance transferred back to card itself? You could then try selling the card.
Yes to what you said earlier about gift cards in general. I personally never buy gift cards from any vendor because I then have funds locked up, but that's not the point in discussion here.