Prep the Onions - Peel and slice the onions into a mix of thin and slightly thicker slices to create texture in the finished soup.
Start the Caramelization - Heat the butter and olive oil in a large pot over medium heat. Add the onions, kosher salt, and black pepper. Stir to coat evenly.
Slowly Caramelize - Cook the onions for 35–45 minutes, stirring every few minutes. Allow them to soften, release moisture, and gradually turn deep golden brown. Add the sugar if using to help speed browning.
Add Garlic - Once the onions are deeply caramelized, add the minced garlic and cook for 30 seconds until fragrant.
Deglaze - Pour in the white wine and dry sherry. Scrape the bottom of the pot to release all the browned bits. Simmer for 2–3 minutes until slightly reduced.
Build the Broth - Add the beef broth, beef consommé (if using), thyme, and bay leaf. Stir well and bring to a gentle simmer.
Simmer - Reduce heat to low and simmer uncovered for 30 minutes, allowing the flavors to fully develop. Remove thyme sprigs and bay leaf before serving.
Prepare the Toppings - While the soup simmers, toast the baguette slices until crisp. Set aside.
Assemble & Broil - Ladle soup into oven-safe bowls. Top each with toasted baguette slices, grated Gruyère, and Swiss (or alternate cheese). Place under the broiler for 2–3 minutes, until bubbly and golden.
Serve - Carefully remove from the oven and serve hot.