Preheat the oven to 375°F.
Fill a large pot ¾ of the way up with water and 2 tablespoons of salt over medium-high heat and bring to a boil. Add the green beans and cook for 2 minutes. Drain in a strainer and immediately dip the green beans into a large bowl of ice water for 2 minutes to stop the cooking. Drain and set aside.
Melt 4 tablespoons of butter in a 12-inch cast iron skillet or in a large sauté pan, over medium heat. Add the shallots and cook, stirring occasionally, for 2-3 minutes. Add the mushrooms to the pan, and cook for 5-6 minutes, stirring occasionally, until they begin to brown. Season with 1 teaspoon salt and ¼ teaspoon black pepper, then add minced garlic and continue to cook for 1 minute. Remove the mushroom and shallot mixture from the pan.
Using the same pan, melt remaining 4 tablespoons of butter over medium heat. Whisk in the flour, remaining 1 teaspoon salt, remaining ¼ teaspoon black pepper, and nutmeg and cook for about 2 minutes, whisking occasionally. Slowly whisk in the stock, half-and-half, and Dijon until combined. Bring the mixture to a simmer over medium heat and cook until thickened, stirring occasionally, about 5 minutes.
Add the green beans and mushroom mixture to the pan with the sauce and toss until fully coated. Sprinkle parmesan all over and bake for 12 to 15 minutes, or until the sauce starts to bubble. Remove from the oven, top with crispy onions, and bake for an additional 5 minutes.
Serve immediately. Enjoy!