Cook the chopped onions in the butter until they are tender and slightly browned. Remove the pan from the heat and sprinkle the onions with the flour and curry powder together using a sifter or a strainer. Add the tomato puree, apple, chutney, and brown sugar. Gradually stir in the water and cook over low heat until the sauce gradually thickens and boils. Season with the nutmeg, salt and pepper to taste.
Prepare the chestnuts: To prepare chestnuts in the shell, use a sharp knife and slice an “X” into the convex side of the nut. Cover the nuts with boiling salted water and cook them for about 20 minutes. Remove the pan from the heat but leave the chestnuts immersed in water. Remove the chestnuts one at a time and discard the shells and inner linings. The edges where you made your slits will have turned out a bit, which makes removing the shells a lot easier. You can also bake them at 400 degrees for about 15-20 minutes with the slit side up.
Arrange the cooked and shelled chestnuts on a buttered baking dish and stir in the curry sauce. Cover the dish tightly and bake for 30 minutes at 350 degrees. Serve with rice or couscous.