Blanch the green beans and plunge into an ice bath to halt the cooking process. Drain when the beans are no longer hot.
In a large sauté pan, melt the butter. Add the garlic and onion and sauté over medium-low heat until softened. Add the mushrooms and thyme and cook until mushrooms are tender and have released their juices. Season to taste with the salt and pepper.
In a heavy saucepan, melt the butter and whisk in flour. Cook for a minute or two to remove the rawness of the flour.
Whisk in milk, about ½ cup at a time, until the sauce is smooth. Add salt and cook, stirring often, until sauce is thick enough to coat a spoon.
Heat butter and olive oil in a sauté pan over medium-high heat. Add the sliced shallots and cook until soft and beginning to turn golden, 3 to 4 minutes.
Add the breadcrumbs and stir to coat. Season with salt and pepper.
To assemble: In a large bowl add the green beans and the mushroom mixture and stir to combine. Pour the sauce over all and stir until well-combined.
Transfer mixture to a large buttered gratin or casserole dish. Smooth the top and sprinkle evenly with the breadcrumb mixture. Bake for about 25 minutes or until the cream sauce is bubbly and the breadcrumbs are golden.