I haven't used chestnut flour but I don't think you would grind the chestnuts with a grain grinder. They are pulverized. You might be able to use a mortar and pestle. Ive used an
electric blade type coffee grinder for other nut flours.
One recipe I've heard of for chestnut flour is chestnut pancakes. Chestnut gnocchi is another. In both cases you can find
recipes where they are chopped instead of using flour.
Cocoa beans are very high fat and if you try to grind them with a mill they gum everything up. What some home chocolatiers do is use a champion juicer. What comes out is a gooey paste but I don't think coconut is as fatty as cocoa. Cocoa has a husk that must be removed.