Preheat your oven to 375°F (190°C). Grease a 9x13-inch or 2.5-quart ceramic baking dish with butter.
Bring a large stockpot of generously salted water to a rolling boil. Add trimmed fresh green beans and blanch for exactly 4 to 5 minutes until vibrant emerald green and crisp-tender. Immediately transfer beans to an ice bath for 2 minutes to halt cooking, then drain thoroughly and pat completely dry.
Melt 2 tablespoons of butter in a large skillet over medium-high heat. Add sliced cremini mushrooms and sauté undisturbed for 3 minutes until browned. Add minced shallot, garlic, and chopped fresh thyme; cook for 2 minutes until fragrant.
Melt the remaining 1 tablespoon of butter in the skillet. Sprinkle flour over the mushroom mixture and whisk constantly for 1 minute to cook out raw flour taste.
Slowly pour in the broth while whisking continuously to prevent lumps. Whisk in heavy cream, ground nutmeg, salt, and black pepper. Bring to a gentle simmer for 3 to 4 minutes until sauce thickens to a glossy, velvety consistency. Stir in grated Parmigiano-Reggiano until melted, then remove from heat.
Gently fold the blanched green beans and 1/2 cup of crispy fried onions into the warm mushroom cream sauce until evenly enrobed.
Transfer the mixture to the prepared baking dish and spread evenly. Bake uncovered at 375°F for 20 minutes until bubbling gently along the edges.
Remove from oven, scatter the remaining 1 1/2 cups of crispy fried onions evenly over the entire top, and return to the oven for 5 to 7 minutes until golden-brown, shattered, and fragrant. Rest for 5 minutes before serving warm.