For the topping: Pulse the bread, butter and salt in a food processor until coarsely ground, about 10 pulses. Combine the bread mixture and onions in a bowl, transfer to a large zip-lock freezer bag, and freeze for up to 2 months.
For the Casserole: Melt the butter in a large skillet over medium heat. Add the mushrooms, salt and pepper and cook until the mushrooms release their liquid, about 5 minutes. Increase the heat to medium-high and cook until the liquid has evaporated, about 5 minutes. Add the garlic and thyme and cook until fragrant, about 30 seconds. Stir in the flour and cook until golden, about 1 minute. Slowly whisk in the wine, broth and cream and bring to a boil. Reduce the heat to medium and simmer, stirring occasionally, until the sauce is thickened, about 10 minutes.
Toss the green beans with the cornstarch in a large bowl and transfer to a 13 by 9-inch baking dish. Pour the warm mushroom mixture evenly over the beans (do not mix). Let cool completely, cover with plastic wrap, cover with foil, and freeze for up to 2 months.
To cook and serve: Remove the casserole from the freezer and take away the plastic from the baking dish and replace the foil. Adjust an oven rack to the middle position and heat the oven to 400 degrees. Bake until the sauce is bubbling and the beans are tender, about 80 minutes, stirring the beans thoroughly and adding almonds or water chestnuts after about 50 minutes. Remove the foil and spread the topping mixture over the beans. Bake until golden brown, about 8 minutes. Serve.
To cook and serve the same day this recipe is prepared: Once the mushroom mixture has been poured over the beans, (do not mix in) cover with aluminum foil and bake in a 350F degree oven for 60 minutes. Remove foil, sprinkle fried onion mixture over top and bake uncovered an additional 10 minutes. Ready to serve!
Note: If you're wanting a gluten-free option, use gluten-free bread where the recipe calls for white sandwich bread and instead of flour in the sauce, use cornstarch (start with only 2 tablespoons).