They canceled the gift card, refunded the money, gave you a free book. I'd say they did what they could (even if it took a couple of turns).
I can understand how they could have (mis-)understood your initial contact as a request to cancel the first transaction. Once your clarification that they should NOT cancel it came, it was already too late. Well, mistakes happen, and this was not a very serious one in most people's eyes. I think many don't understand how this can be such a big deal. After all you DID intend to "just" spend $50.
If this is your worst customer service experience ever, consider yourself blessed! (Try dealing with Greyhound bus lines' refund department if you want to try something really frustrating.
)