Preheat oven to 350 degrees Fahrenheit. Spray a 9 x 13-inch baking dish with cooking spray.
In a small saucepan, melt the butter over medium heat. Whisk in the flour until smooth, whisking constantly. Add in the milk a little at a time, whisking continuously. Add the crème fraiche, thyme, salt and pepper and keep whisking until the mixture is thick and creamy, about 5 minutes. Remove from heat.
Heat 2 tablespoons of the olive oil over medium-high heat. Add the mushrooms and saute for 3 minutes per side, until golden. Transfer mushrooms to a large bowl and set aside. To the same pan, add the remaining 2 teaspoons oil and heat over medium-high. Add the beans and saute for 5 minutes, until the color has brightened. Transfer beans to the bowl with the mushroom.
Pour the prepared sauce over the beans and mushrooms, stirring gently until evenly coated with the sauce. Transfer to the prepared baking dish and top with the fried onions and Parmesan.
Bake for 20 minutes, or until the cheese is melted.