Adjust an oven rack to the middle position and preheat to 375 degrees F. Lightly butter a 9- by 13-inch baking dish.
Lay 6 slices of the bread in a single layer on the bottom of the baking dish (trim if needed). Sprinkle 2 heaping tablespoons of the gruyere on top of each slice. Then top each with 2 slices of the ham, folding the ham if needed to fit on top of the bread. Place the remaining 6 slices of bread on top of the of the ham to form 6 sandwiches. Sprinkle the remaining gruyere on top and on the sides of the sandwiches. Set aside.
Whisk together 4 of the eggs, the half-and-half, cinnamon, nutmeg, 1 teaspoon salt and 1/2 teaspoon pepper in a large mixing bowl. Pour on top of the sandwiches. Use your hands to lightly press the sandwiches down into the custard.
Spray a large piece of foil with nonstick spray. Place the foil, sprayed-side down, on top of the baking dish, crimping the sides of the foil around the dish. Bake for 30 minutes. Remove the foil and bake until the custard is set but still slightly jiggly, about 10 minutes. Switch the oven to broil and broil until the top is light golden brown, 3 to 5 minutes.
Allow the casserole to rest at room temperature for 20 minutes.
Meanwhile, heat the butter in a large nonstick pan over medium heat. Crack 3 eggs into the pan (it's ok if they stick together) and lightly sprinkle with salt and pepper. Cook until the whites start to set, 2 to 3 minutes, and then cover and continue cooking until the whites are set but the yolks are still runny, 1 to 2 minutes. Place each on top of a sandwich. Repeat with the remaining 3 eggs.
Use a metal spatula to remove a sandwich with egg from the casserole and place on a serving plate. Serve with warm maple syrup for drizzling.
Copyright 2013 Television Food Network, G.P. All rights reserved