Prepare the Ingredients. Preheat oven to 400°F. Mushrooms: Quarter ¾ of them for the casserole and finely mince the remaining ¼ for the sauce. Onion: Dice half and thinly slice the other half. Place the sliced half in a bowl with buttermilk to soak while you make the casserole (for the crispy topping). Garlic: Mince cloves if not already done
Blanch the Green Beans. Bring a large pot of salted water to a boil. Add green beans and cook for 3–4 minutes, until bright green and just tender. Transfer immediately to an ice bath to stop cooking. Drain and set aside.
Lightly grease a 9×13-inch baking dish and add the green beans and quartered mushrooms.
Make the Sauce In a large skillet, melt butter over medium heat. Add the diced onion, minced mushrooms, and garlic. Sauté for 8–10 minutes, until softened and the mixture is fragrant and slightly reduced. Whisk in flour to form a paste (roux) and cook 2–3 minutes to remove any raw flour taste. Gradually whisk in the half-and-half, a little at a time, until smooth and thickened. Stir in salt, pepper, thyme, and Parmesan until creamy and well combined.
Pour the sauce evenly over the green beans and mushrooms in the baking dish. Cover with foil and bake for 45 minutes. Remove foil and bake an additional 15 minutes, until bubbly and the beans are tender.
In a shallow bowl, combine flour, salt, garlic powder, and paprika. Working in batches, remove the soaked onion rings from the buttermilk, dredge in the flour mixture, and shake off any excess.
Heat oil in a skillet to 375°F. Fry onions in small batches until golden and crisp. Transfer to a paper towel-lined plate and season lightly with salt.
Top the baked casserole with crispy onion strings just before serving. Serve immediately.