Preheat oven to 375 degrees then spray a 2-quart baking dish with nonstick spray and set aside.
Steam green beans until crisp-tender then set aside.
Heat oil in a medium sized skillet over medium-high heat. Add 1/4 of the shallots then saute, stirring frequently, until golden brown, 1-2 minutes. Transfer shallots to a paper-towel lined plate to drain then sprinkle with salt. Repeat with remaining shallots then set aside.
Add mushrooms to the remaining oil then saute until the mushrooms have released their liquid. Continue to saute until the liquid has cooked off and the mushrooms are golden brown. Add the garlic, thyme, salt, and pepper then saute for 1 more minute. Transfer mixture to a large mixing bowl.
In a measuring cup, whisk together milk and flour until well combined then pour into the skillet. Season generously with salt and pepper then bring mixture to a bubble while whisking constantly. Turn heat down to medium/medium-low then stir using a spatula until mixture is thick and bubbly, 10 minutes. Turn off the heat then add the parmesan cheese and stir until smooth. Pour mixture into bowl with mushrooms. Add green beans and parsley to the bowl then stir to combine.
Spoon green bean mixture into prepared baking dish then top with crispy shallots and remaining parmesan cheese. Bake for 20 minutes or until golden brown on top.