You've handled it already but I hope the talk included some strong direction on your part about how she spoke to YOU, not just how she threw the earrings away. Was she remorseful when you talked about how hurtful it is to throw away someone's gift even if it doesn't work for you? And even if the gift-giver doesn't know you've treated the gift that way?
If she got it and was really remorseful--good; if not, it's possible she knows she got let off the hook as far as apologizing and may interpret that, in her five-year-old brain, as her attitude getting her what she wanted, namely, to not have to apologize when she didn't want to.
In order not to keep shifting your reaction, I would not now go back make her apologize if you are "leaving grandma out of it" as the SWH says. But I would absolutely have her write a thank-you note to grandma for both gifts with no mention of the incident. If she doesn't write much, have her draw or collage a gorgeous card for grandma. Help her address the envelope and send it via mail, the formal way. Make her take time with it whether she wants to or not. (If she says, "I told her thank you already" but there was no note or card made, still make her do one. Don't make her think that doing the card is a punishment for her actions, though, or she'll resent thank-you notes forever. Just be clear that we thank people when they take time to make us things.)
I would have not given back the jewelry box, myself, no matter how much care she had taken with it (and how long had she had it to "take care" of it anyway? Sounds like days.). She really has suffered little consequence here that would give her pause next time -- she gets her box, the earrings got retrieved and fixed, she didn't have to apologize to anyone, and--as far as I can tell from the SWH so maybe I'm wrong -- she wasn't given an immediate consequence for her surprising replies to you.
I DO get that this is not like her and it's hard to know how to react in the moment when our kids do something that takes us aback. But I would think now about how you plan to handle it if she brings out this attitude again and what consequences you will use if she does, so you're ready.This may be a complete one-off and never happen again; kids her age are still very young and don't think through things.
I would make sure that she makes all her gifts to grandparents, aunts, uncles, etc. by hand herself, for while to come. Don't drag this incident into it, or even mention the earrings, but do mention how lovely it is to make and get handmade gifts that take time and effort.