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 into the skillet at a time then saute, stirring frequently, until golden brown, 1-2 minutes. Transfer shallots to a paper-towel lined plate to drain then repeat with remaining shallots, sprinkle with salt, and set aside. Add mushrooms to the remaining oil then saute, stirring occasionally, until golden brown and all the liquid has evaporated, 10-12 minutes. Add garlic, thyme, salt, and pepper then saute for 1 more minute. Transfer mixture to a large bowl. Whisk together milk and flour until well combined then add to 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, 15 minutes. Add parmesan cheese then pour mixture into bowl with mushrooms. Add green beans and parsley then stir to combine. Spoon green bean mixture into prepared baking dish then top with crispy shallots and remaining parmesan cheese, then bake for 20 minutes or until golden brown on top.