Place cubed bread in a single layer on a large baking sheet. Bake until slightly dried out, 10 to 15 minutes. Remove from oven; set aside.
In a medium skillet, heat oil over medium-high heat. Add onion; cook until tender, about 5 minutes. Remove from skillet. Add spinach to skillet; cook until just wilted, about 2 minutes. Remove from heat.
Spray a 13x9-inch baking dish with cooking spray. Place half of cubed bread in prepared pan. Top with half of onion, half of spinach, 1⁄2 cup Cheddar, 1⁄2 cup Swiss, and half of ham. Top with remaining cubed bread, remaining onion, remaining spinach, remaining 1⁄2 cup Cheddar, remaining 1⁄2 cup Swiss, and remaining ham.
In a large bowl, whisk together eggs, half-and-half, salt, and pepper until combined. Pour egg mixture over casserole. Cover and refrigerate for at least 2 hours or overnight.
Preheat oven to 350°. Bake, uncovered, until center is cooked through, 45 to 50 minutes. Let cool slightly before serving.