Preheat the oven to 375 F. Start by frying the shallots. Thinly slice the shallots then break the layers apart (so they look like mini onion rings). Add the sliced shallots to a bowl and add the flour. Toss to combine.
Add the oil to a pan over medium high heat. When the oil is hot, carefully transfer the shallots into the hot oil, working in batches if needed. Flip the shallots over occasionally. Cook until golden brown then transfer to a paper towel lined plate. Set aside.
Bring a large pot of water to a boil. Add the green beans and cook for 5 minutes, then transfer to a bowl of ice water to stop the cooking.
Add the butter to a pan over medium heat. Add mushrooms and onion and cook until tender, about 5 minutes. Add garlic, dried thyme, salt, and pepper and stir.
Sprinkle the flour over everything then stir until combined. The mixture will be quite thick. Add chicken broth, stir, and let cook for 2 minutes. Add the milk and cook for 2 more minutes. The mixture should be a creamy, thick sauce. Add the parmesan cheese and stir until melted.
Turn off the heat. Transfer the green beans into the pot and stir until they are evenly coated with sauce. Transfer the mixture to an oven safe pan (or just use the pan it's already in if that is oven safe), transfer to the oven and cook for 15 minutes.
Top with the fried shallots and serve. Enjoy!