Once upon a time, when I had my chocolate club in college, one of the topics was Books & Chocolate. Out of all the books that reference chocolate, Harry Potter was, naturally, the story everyone in the room was familiar with. But what I realize, months later, after further thought is that the series covers two very different aspects of chocolate. It does not go into what I like to call couture chocolate, but it does address nostalgic chocolate and healing chocolate.
Nostalgic chocolate centers around the Chocolate Frogs. They're one of the treats to buy on the Hogwarts Express and something to give as a gift to a friend. That hits at the comfort of childhood, when a chocolate candy was enough to brighten your day and connect you to other people. Chocolate confections have enough impact that even years later, when you might not enjoy their taste in the same way anymore, still they remain special because of the memories they evoke.
Healing chocolate is what Lupin gives to Harry after his encounter with the dementors. The idea here seems to be based on the fact that the dementors force you into unhappy feelings and chocolate is something positive, therefore chocolate can help bring you out of that negative mood. Chocolate doesn't have such a direct healing aspect in our world, but you can still consider it to have healing properties. Emotionally, once again, it is positive. But depending on the type of chocolate, it can in fact be a natural and even healthy food. Chocolate made with good quality cocoa beans and pure ingredients instead of fillers, well, that helps make for a rounded diet, I say.
Nostalgic chocolate is the more common view of chocolate, unsurprising to find in a YA series. Healing chocolate is less common to find expressed, especially without the mention of cacao beans (like in the movie version of Chocolat). Both of these sides coming together in this book, then, sets up a rather uncommon dichotomy.