Prep the pan: Grease a 9x13-inch baking dish with butter or oil. Preheat your oven to 350°F (175°C) if baking right away.
Toast the bread (optional but helpful): If your bread is very soft, spread the cubes on a sheet pan and toast at 300°F for 8–10 minutes to dry them slightly.
This helps the casserole set.
Sauté the veggies: Warm a skillet over medium heat with butter or oil. Cook onions and peppers 3–4 minutes until softened. If using mushrooms, cook until their moisture evaporates.
Stir in spinach last and wilt briefly. Let cool slightly.
Whisk the custard: In a large bowl, whisk eggs, milk, Dijon, garlic powder, onion powder, thyme, salt, and pepper until smooth.
Layer the base: Add bread cubes to the baking dish. Scatter ham and sautéed vegetables over the top.
Sprinkle most of the cheese evenly.
Add the custard: Pour the egg mixture over everything, pressing down gently so the bread absorbs the liquid. Top with the remaining cheese.
Rest time: Let it sit 10–15 minutes at room temperature, or cover and refrigerate overnight for the best texture.
Bake: If chilled, uncover and bake 45–55 minutes at 350°F, until the center is set and the top is golden. If baking right away, start checking at 40 minutes.
A knife inserted near the center should come out clean.
Finish and serve: Rest 10 minutes before slicing. Sprinkle with fresh herbs and serve warm.