I can't find any trace of this story by searching; I feel like it was in "The Great Brain", but searches aren't coming up well. Nor can I find a record of this kind of gingerbread. The description sounds more like a Christmas pudding than any kind of gingerbread I can find, which is usually either the hard cookie or a softer spicy cake.