In a large skillet, sauté onions, sugar, and 1 teaspoons salt in the clarified butter over medium high heat, stirring constantly to prevent burning. Cook until golden brown. Add sherry to lift any caramelized onion on the bottom of the pan. Remove from heat and set aside.
Spread bread pieces evenly on baking sheet. Place in oven for about 5 to 8 minutes. Set aside to cool.
Whisk together the eggs, cream, mustard, thyme, remaining 2 teaspoons salt and pepper. Soak bread in the egg mixture for 5 minutes.
In a casserole dish, layer bread, onions then cheese. Pour remaining egg mixture over the top.