Grease a 9 x 13 in. casserole dish with oil.
Toss the bread cubes with 2 Tbsp. of the oil, 1/4 tsp. salt, and a few grinds of pepper in a large bowl. Heat a large skillet over medium heat. Add the bread to the skillet, and cook, tossing occasionally, until toasted and golden brown, about 8 minutes. Return the toasted bread to the bowl to cool.
Wipe out the skillet. Heat the remaining 2 Tbsp. oil over medium-high heat until it starts to shimmer. Add the mushrooms in one layer (resist the urge to stir right away), and cook until they start to brown, about 3 minutes; stir, then continue to brown for 2 minutes more. Add the garlic, thyme, 1/4 tsp. salt and some pepper, stir continuously for 1 minute, then fold in the spinach and another 1/4 tsp. salt. Continue to cook, stirring often, until the spinach is wilted, 1 to 2 minutes. Remove from the heat.
Place half the bread cubes in the prepared casserole dish, and sprinkle them with half each of the Gruyere and Parmesan. Add the mushroom-spinach mixture in an even layer. Top with the remaining bread cubs, Gruyere and Parmesan. In a large bowl, whisk together the eggs, half and half, 1/2 tsp. salt and several grinds of pepper. Pour the egg mixture into the casserole dish. Cover with plastic wrap, and refrigerate for at least 6 hours up to overnight. Remove the casserole from the refrigerator 30 minutes before baking.
Preheat the oven to 350 degrees. Bake the casserole until custard is set and the top is golden brown, 50-55 minutes. Cool for at least 15 minutes before serving warm or at room temperature.