Preheat the oven to 375 degrees.
Lightly spray a casserole dish with cooking spray. Arrange the thawed green beans at the bottom of the baking dish.
Sauté the onion in 5 tablespoons of butter for about 5 minutes on medium heat. Add the mushrooms and sauté for another 3 minutes.
Remove the mushrooms and onion from the pan and pour them evenly over the green beans.
Cover the green beans and mushrooms with the cheese slices.
Add 3 additional tablespoons of butter to the same pan on medium heat. Once the butter is melted, add 2 tablespoons of flour to the butter and stir with a whisk to combine. Cook for about 2-3 minutes while stirring constantly.
Add the chicken broth and garlic powder and mix thoroughly with a whisk for about 2-3 minutes.
Add the half and half slowly (I typically add 1/4 cup every 30 seconds) and continue to whisk.
Add the sherry cooking wine and continue to whisk until the sauce starts to thicken.
Taste the sauce and add salt and black pepper if needed. I don't include a specific amount because it will vary depending on the amount of salt in the broth.
Spread the mixture on top of the green beans and mushrooms and the cheese slices and bake for 35 minutes, uncovered.
Remove the casserole from the oven and add the fried onions to the top of the casserole and bake for another 10 minutes. Watch the casserole carefully to ensure the topping does not burn.