Treebeard says "a wizard should know better." That's the reference. It's a quote. You see Treebeard said "a wizard should know better. JumpyDragon said "Harry should have known better." Harry is a wizard.
What history is it that I don't understand that you do and how does it have any relevance? Is no one allowed to make LotR references when talking about the DF? Somebody better tell Harry.
Harry is a mere human, a wizard, yes, but in the end, human, humans make mistakes. So is it Harry, as a human should know better? Or a wizard of limited experience, with experience, wisdom comes eventually, I disagree as far as Harry avoiding introspection, he is constantly contemplating his navel, if he didn't he would never have gotten any sort of handle on the Winter Mantel. He was able to resist the Shadow of Lasciel and in the end change the Shadow to Lash because he never wished to be a dominating power, thus he rejected the coin.. That is why in the end she sacrificed herself for him.
In contrast...
The wizards of LotR are not human, they are not even elves, they are of the Valinorean race sent to Middle-earth to contest the will of Sauron. The quote from Treebeard was about Saruman the White, he saught to become a power onto himself, some say he was of the Elder race, seduced to evil in the first age when he became a servant of a greater Power, Morgoth of Angband. When Treebeard said that quote, Saruman had burned down a great deal of Fanghorn Forest and had gathered Orcs about him to gain power, he himself lusted for the Ring.. Treebeard was right, he should have known better.