For the Caramelized Onions: In a large skillet, melt butter over medium heat, then add onions, sugar, and 1 teaspoon salt. Cover and cook, stirring every few minutes, until onions have softened, about 10 minutes. Remove lid and cook, stirring frequently and keeping skillet uncovered, until onions are deep golden brown, 20 to 25 minutes; if onions threaten to burn at any point, stir in a tablespoon or two of water as needed, and/or lower heat. Add garlic and thyme and cook 1 minute longer. Add sherry and wine and cook until liquid has almost completely evaporated, about 3 minutes. Remove from heat and set aside.
Meanwhile, for the Strata: Preheat oven to 350°F (177°C). Spread bread in a single layer on a baking sheet. Bake until bread is dry but not browned, about 8 minutes.
In a large bowl, whisk together eggs, half and half or milk, mustard, Worcestershire sauce, fish sauce (if using), 1/2 teaspoon salt, and pepper. Add dried bread and let soak in custard for at least 15 minutes and up to 30 minutes.
Butter a 12-inch cast iron skillet or a 9- by 13-inch baking dish and add half of bread. Scatter half of caramelized onions and half of cheese all over. Layer remaining bread on top and scatter remaining onions and cheese over. Drizzle any remaining custard all over, then bake until bread is crisp and custard is just set, about 35 minutes. Serve hot or at room temperature.