Place the onions and olive oil in a 9x13" baking dish, tossing to coat the onions with oil. Bake for about 30 minutes, stirring 3-4 times with a wooden spoon, until the onions are browned and sizzling. Remove from the oven and set aside.
While the onions are roasting, prepare the whole, unpeeled chestnuts as follows: Slice a little slit in the shell of each chestnut to prevent them from exploding. Place the chestnuts on a rimmed baking sheet and roast for 25 minutes. Remove from the oven and place in a kitchen towel. Let cool a bit and crush them inside the towel to loosen their shells. Open the towel and remove the shells from the chestnuts.
Coarsely chop the peeled chestnuts and add to the pan with roasted onions.
Add the diced butternut squash, white beans, thyme, coriander, nutmeg, salt, pepper, and broth to the baking pan, stirring so that the chestnuts, squash and beans are well coated. Tightly cover the baking pan with aluminum foil and bake for 35-45 minutes, until the squash and chestnuts are tender.
Toss together the bread crumbs, oil and sage in a bowl. Season to taste with salt, pepper, and cayenne. Remove the foil from the baking pan, top with the crumb mixture and bake for another 15 minutes, until the top is lightly browned.