Coat a 3-quart (13×9-inch) baking dish with butter and set aside.
Place a large frying pan over medium heat and add butter. When butter is slightly frothy, add onion, season with salt, stir, and cook until just softened, about 3 to 4 minutes. Then add garlic, season with salt and pepper, and cook until beginning to soften and fragrant, about 1 minute. Remove from heat and stir in thyme.
Whisk together eggs, half-and-half, mustard, hot sauce, and salt in a large bowl until evenly combined. Arrange half of the cubed bread in bottom of prepared dish. Sprinkle with 1 cup Gruyere and half each of onion-garlic mixture and ham. Repeat layering with remaining bread, onion mixture, ham, and Gruyere cheese. Pour egg mixture over top.
Press down on bread to fully submerge in egg custard, cover with plastic wrap, and weigh down with a heavy plate. Refrigerate for 3 to 12 hours.
When ready to bake, remove weight and plastic wrap from casserole, cover with aluminum foil, and place in oven on middle rack. Set oven temperature to 325°F (no need to preheat) and bake for 35 minutes. Remove foil and increase temperature to 375°F. Sprinkle parmesan over the strata and bake for another 10 to 15 minutes until golden brown.
Remove from oven and sprinkle over remaining thyme. Allow to cool for at least 5 minutes. Serve with hot sauce on the side.
Recipe adapted from: http://saltandwind.com