Set the Instant Pot to the 'Sauté' function. Add butter to the pot and let it melt.
Add the sliced onions and sugar, stirring frequently. Cook the onions for about 15 minutes, or until they are caramelized and golden brown.
Add minced garlic, dried thyme, and bay leaf to the caramelized onions. Cook for an additional 1-2 minutes until fragrant.
Pour in the white wine and scrape the bottom of the pot to deglaze. Allow it to simmer for 2-3 minutes until slightly reduced.
Add the beef broth to the pot and season with salt and pepper. Stir to combine.
Secure the lid on the Instant Pot and set it to 'Pressure Cook' on high for 10 minutes. Once done, carefully release the pressure.
Preheat your oven broiler on high.
Remove the bay leaf from the soup and taste for seasoning, adjusting if necessary.
To serve, ladle the soup into oven-safe bowls, top each bowl with a slice of toasted baguette, and sprinkle with Gruyère cheese.
Place the bowls under the broiler for about 2-3 minutes or until the cheese is melted and bubbly. Watch closely to prevent burning.