Line a baking sheet with three layers of paper towel; set aside. In a small bowl, toss the shallots with 1/4 teaspoon salt, 1/8 teaspoon pepper, and 2 tablespoons of the flour; set aside. Heat 3 tablespoons of the oil in a 12-inch nonstick skillet over medium-high heat until smoking. Add the shallots and fry, stirring frequently, until golden and crisp, about 5 minutes. Transfer the crispy shallots to the lined baking sheet.
Carefully wipe out the hot skillet and return to medium-high heat. Add the remaining 2 tablespoons oil, mushrooms, and 1/4 teaspoon salt; cook, stirring occasionally, until browned, about 8 minutes. Transfer to a plate and set aside.
Wipe out the skillet again. Melt the butter over medium heat. Once the foaming subsides, stir in the minced onion and cook, stirring occasionally, until the edges begin to brown, about 2 minutes. Stir in the garlic and remaining 1 tablespoon flour, then toss in the green beans, thyme, and bay leaves. Pour in the cream and chicken broth, increase the heat to medium-high and cover. Cook until the beans are partly tender, but still crisp in the center, about 4 minutes.
Remove the cover and add the cooked mushrooms back to the skillet. Continue to cook over medium-high heat, uncovered, until the green beans are tender and the sauce has slightly thickened, about 4 minutes. Remove from heat, discard the bay leaves and thyme sprigs. Add salt and pepper, to taste. Transfer to a serving dish, then sprinkle evenly with the crispy shallots. Serve immediately.
Source: Slightly adapted from The New Best Recipe