Preheat the oven to 400�F. Coat a 2 1/2-quart baking dish with cooking spray.
Heat 1 tablespoon of oil in a large saucepan over medium heat. Add the diced onion, and cook, stirring often, until they are softened and slightly translucent, about 4 minutes.
Stir in the mushrooms, onion powder, 1 teaspoon of salt, thyme, and pepper. Cook, stirring often, until the mushroom juices are almost evaporated, 3-5 minutes.
Sprinkle 1/3 cup of flour over the vegetables; stir to coat. Add the milk and sherry and bring to a simmer, stirring often.
Stir in the green beans and return to a simmer. Cook, stirring, until heated through, about 1 minute. Stir in the sour cream and buttermilk powder. Transfer to the prepared baking dish.
Whisk the paprika, the garlic powder, the remaining 1/3 cup of flour, and the remaining 1/4 teaspoon of salt in a shallow dish. Add the sliced onion; toss to coat.
Heat the remaining 2 tablespoons of oil in a large nonstick skillet over medium-high heat. Add the onion, along with any remaining flour mixture, and cook, turning once or twice, until golden and crispy, 4-5 minutes. Spread the onion topping over the casserole.
Bake the casserole until bubbling, about 15 minutes. Let cool for 5 minutes before serving.