The two things that go wrong with roast chestnuts are that they explode, and that you cannot peel them afterwards. Both are solved before they go in the oven.
Chef Perry roasts a two pound batch here with butter, rosemary, salt and pepper, and the whole method rests on two steps most recipes leave out.
Score them or they burst
A chestnut is a sealed shell with moisture inside. Heat it and that moisture turns to steam with nowhere to go. Cutting a shallow X through the husk gives the steam an exit, and it is also the gap your thumbnail gets into later.
Use a small serrated knife and sit each nut flat side down. A tea towel under the board stops everything sliding while you cut.
The soak is what makes them peel
Half an hour in very hot water softens the husk and adds the moisture that steams the nut from the inside. Skip it and you get a chestnut that roasts dry, with a skin welded to the meat.
The loose foil parcel does the same job in the oven, trapping steam around the nuts rather than letting it escape. Leave a small opening at the top so it vents rather than bursting.
Peel them hot
Warm husks come away like a hard-boiled egg shell. Cold ones grip. Do them straight out of the rest, and be aware the roasted edges get genuinely sharp - kitchen gloves are not a silly idea for a big batch.
If you want them sweet instead
Swap the salt, pepper and rosemary for brown sugar and cinnamon in the same melted butter. Everything else about the method stays the same. A few whole heads of garlic tucked into the parcel also work well alongside the savoury version.