Prep and preheat: Heat your oven to 375°F (190°C). Grease a 9x13-inch baking dish with cooking spray or a little butter.
Blanch the beans: Bring a large pot of salted water to a boil.
Add green beans and cook 3–4 minutes, until bright green and crisp-tender. Drain and plunge into a bowl of ice water to stop the cooking. Drain well and pat dry.
Sauté aromatics and mushrooms: In a large skillet, heat 2 tablespoons butter and the olive oil over medium heat.
Add onion and a pinch of salt; cook 3–4 minutes until softened. Stir in mushrooms and cook 5–6 minutes, until they release liquid and turn golden. Add garlic and cook 30 seconds.
Make the roux: Push veggies to the edges of the pan.
Melt remaining 2 tablespoons butter in the center. Sprinkle in flour and stir constantly for 1 minute to form a paste.
Build the sauce: Slowly whisk in the broth, then the milk or half-and-half. Simmer 2–3 minutes, stirring, until thick and smooth.
Season with 1/2–1 teaspoon salt, black pepper, and smoked paprika if using. Whisk in Dijon.
Add the cheese: Reduce heat to low. Stir in 1 cup cheddar and 3/4 cup Gruyère until melted and silky.
Taste and adjust seasoning.
Combine with beans: Add the blanched green beans to the skillet and toss to coat evenly. Transfer to the prepared baking dish and spread in an even layer.
Make the topping: In a bowl, combine French fried onions, panko, Parmesan, and remaining cheddar and Gruyère. Toss to mix.
Top and bake: Sprinkle the topping evenly over the casserole.
Bake 18–22 minutes, until the edges bubble and the top is golden brown. If the topping browns too fast, tent loosely with foil.
Rest and serve: Let the casserole sit 5–10 minutes before serving so it sets and slices cleanly.