How to Make It
Preheat oven to 350°F. Squeeze green beans lightly in hands to remove water.
Heat 2 tablespoons of the butter in a Dutch oven over medium-high. Add mushrooms and shallot, and cook, stirring often, until mixture is deeply browned and caramelized, 8 to 10 minutes. Transfer mixture to a plate, and without wiping out Dutch oven, add remaining 6 tablespoons butter to Dutch oven. Melt butter over medium-high; whisk in flour, and cook, whisking constantly, 1 minute. Gradually add milk, whisking until smooth. Cook, whisking, until thickened and bubbly, about 4 minutes. Remove from heat, and whisk in Parmesan cheese, kosher salt, and black pepper until melted and smooth. Stir in green beans, mushroom mixture, and water chestnuts; spoon into a lightly greased 13- x 9-inch (3-quart) baking dish.
Bake in preheated oven until bubbly around edges, 15 minutes. Remove from oven; top with fried onions or shallots. Return to oven; bake until topping is golden brown, 15 minutes.
Make it ahead: Prepare recipe through Step 2 up to 3 days in advance; cover and refrigerate. On the day of, add toppings and bake; add 10 minutes to the initial bake time if using a refrigerated casserole.
Bacon-Brussels Sprout-Green Bean Casserole: Substitute 1 lb. trimmed and quartered fresh Brussels sprouts for 1 pkg. green beans. Cook 6 bacon slices in a Dutch oven over medium until crisp, 6 to 8 minutes. Drain bacon on paper towels, reserving drippings in Dutch oven. Crumble bacon; set aside. Cook Brussels sprouts and green beans in reserved drippings just until tender and lightly browned, 8 to 10 minutes. Remove vegetables from Dutch oven. Prepare recipe as directed without wiping out Dutch oven, stirring Brussels sprouts and green beans into cream sauce with mushroom mixture and water chestnuts at the end of Step 2. Top with bacon and fried onions or shallots after 15 minutes of baking in Step 3.
Lemon-Almond Green Bean Casserole: Omit mushrooms and fried onions or shallots. Stir together 1 cup panko (Japanese-style breadcrumbs), 1 cup untoasted sliced almonds, 1/2 tsp. kosher salt, and 2 Tbsp. melted salted butter. Prepare as directed, whisking 1 Tbsp. fresh lemon juice into cream sauce and stirring 1/2 cup toasted sliced almonds into green bean mixture in Step 2. Top casserole with panko mixture; bake 30 minutes at 350°F.