Preheat the oven to 375°F.
Bring a large pot of water to a boil. Once boiling, add in the green beans and cook for 3 minutes. Drain immediately and place green beans into a bowl filled with cold water and ice to stop the cooking process. Once cool, drain the green beans and set aside.
In a large skillet over medium heat, add the butter. Once melted, add the mushrooms and garlic and sauté until the mushrooms are tender and lightly golden, about 3-4 minutes.
Next, add the flour and stir until well combined and the flour has mostly dissipated. Slowly pour in the chicken broth and stir well to combine, be sure to hit any hidden pockets of flour. Use a wooden utensil to scrape up any browned bits on the bottom of the pan.
Stir in the lemon juice, Dijon mustard, Worcestershire, thyme, red pepper flakes (if using), ground nutmeg, and salt/pepper- to taste, stirring well to fully combine. Bring this mixture to a simmer for 2-3 minutes.
Then stir in the cream (or half and half) along with half of the parmesan, stirring until well incorporated, about 1-2 minutes.
Place the blanched green beans into an oven-safe casserole dish (like a 10×10-inch or 9×13-inch baking dish) and pour the creamy mushroom sauce on top and toss until well coated. Evenly sprinkle the remaining parmesan over the green bean mixture.
Transfer the dish into the oven and bake for 20 minutes.
Then remove from the oven and toss the mixture once more. Evenly sprinkle the fried shallots over the green beans. Place back into the oven to bake for another 7-10 minutes, careful not to burn.
Serve this green bean casserole immediately. Enjoy!