Heat butter in a large pot or dutch oven. Add garlic, sliced onions and salt and cook over medium heat for 30 minutes. Remain at the stove, stirring every few minutes to ensure the onions do not burn.
Add 1 teaspoon of sugar, turn the heat to low and cover with a lid. Continue cooking for approximately 50 minutes, until onions are golden brown and caramelized.
Remove the lid and add flour to the caramelized onions. Mix well and cook for another 5 minutes.
Add mushroom broth, Worcestershire sauce, sherry, thyme and cracked pepper and simmer for 20 minutes.
Meanwhile, slice baguette in 1/2 inch rounds and toast until crunchy.
Preheat oven to 350F.
Line a baking sheet with aluminum foil. Place 4-6 oven proof bowls on the baking sheet and ladle soup into the bowls. Add 3 tbsp of shredded gruyere cheese to each bowl, mix well.
Gently place one or two slices of bread on the top of each soup bowl then sprinkle with 1/4 cup of gruyere cheese per bowl.
Place baking sheet in the oven and bake for 10 minutes, until cheese is melted and bubbling.
Broil for 1-2 minutes, keeping an eye so the bread doesn’t burn. Serve immediately.