Preheat the oven to 350 degrees F.
In a large skillet, saute the onions, sugar, and 1 teaspoon of the salt in the clarified butter over medium-high heat; stir constantly to prevent burning. Cook until golden brown. Add sherry and stir to lift any caramelized onion on the bottom of the pan. Remove from the heat and set aside.
Spread out the bread pieces evenly on a baking sheet. Place in the oven for about 5 to 8 minutes to dry the bread slightly but not to add color. Set aside to cool.
Whisk together the eggs, cream, mustard, thyme, the remaining salt, and pepper. Soak the bread in the egg mixture for 5 minutes.
In a casserole dish, layer the bread with the onions and cheese. Pour the remaining egg mixture over the top.
Bake for 35 minutes or until the egg mixture is set.
*Clarified butter is unsalted butter that has been slowly melted, separating the milk solids from the liquids. After removing any foam off the top, the golden butter is poured or skimmed off the milky residue. Clarified butter is used to cook at higher temperatures because it has a higher smoke point.
Recipe courtesy of The Cookworks