In a large bowl, combine sliced onions, flour, salt, and onion powder. Mix together making sure onions are coated with the flour/seasoning mixture.
Add 2-4 inches of oil to a deep skillet. Heat the oil to about 350 degrees. Add about one fourth of the onions to the hot oil and cook, turning them over with tongs until they are golden brown (about 3-5 minutes). Remove from oil and place on a plate or wire rack lined with paper towels. Repeat with the remaining onions and set aside.
Add water to a large stockpot until about half full and add 1 tablespoon of salt. Fill a large bowl with ice water. When water in the stock pot is boiling, add the trimmed and halved green beans and boil for about 5 minutes. Remove beans from boiling water with a strainer or slotted spoon, and place in the bowl of ice water. Leave in water for a couple of minutes, then drain and set beans aside.
In a large skillet, heat the 4 tablespoons of butter over medium-high heat. Add sliced mushrooms and cook for about 2-4 minutes, stirring often. Add minced garlic, salt, pepper, and nutmeg. Stir everything together to combine.
Add flour to the mixture, and then whisk in chicken broth, simmering for about 4 minutes. Then reduce heat to medium and whisk in the heavy cream. Cook and stir for about 5 minutes, until sauce begins to thicken. Remove from heat. I recommend tasting the mushroom sauce at this point and adding more salt if needed.
Pour blanched beans into the skillet and mix well with sauce. Transfer mixture to prepared baking dish (you can also bake in a large cast iron skillet if you prefer).
Bake at 375 degrees for about 15-20 minutes until casserole is bubbly.
Remove casserole from oven, top with the fried onions, and serve.
Notes
To make in advance: make the green bean casserole up to a day before you plan to serve (without the fried onions). Reheat in a 350 degree oven.
Make the fried onions shortly before serving, and top casserole with onions just before serving.