Preheat the oven to 450°F, 230°C, or gas mark 8 and bring a large pot of salted water to a boil.
Making the onion topping
In a mixing bowl toss the onions in the olive oil. Then add the flour, salt, breadcrumbs, and garlic powder. Toss until the onions are evenly coated.
Place on a sheet pan and bake for 15 minutes tossing halfway. Remove from the oven.
Once they are done reduce the heat to 375°F, 190°C, or gas mark 5.
Cooking the green beans
Fill a large mixing bowl with ice water and set next to the stove.
Once the water has started boiling add half of the green beans and cook for 3-4 minutes. Strain from the water and immediately plunge into the ice water. Repeat with the remaining green beans. Pour out the water once all of the beans are chilled.
Making the mushroom cream sauce
In a cast iron skillet on medium-high, heat 4 tablespoons of the butter. Once it has melted add the mushrooms, salt, pepper, and thyme. Leave to cook undisturbed for 2 minutes before stirring and flipping over. Allow the other side to cook undisturbed for another 2 minutes. Add the roasted garlic, stir and continue to cook until done. Remove from the pan and place into a bowl.
Return the pan to the heat and melt the remaining 4 tablespoons of butter. Add the flour and stir until the flour starts to darken to a light caramel color. About 3-5 minutes. Add the milk and cream and whisk until combined. Keep whisking and bring to a boil. remove from the heat and add nutmeg and parmesan cheese.
Stir in the mushrooms and green beans. Bake for 15 minutes. Add the onion topping and bake for another 5 minutes.