Melt the butter in the Instant Pot on the saute setting. Add the onions and stir to coat with the butter.
Switch the Instant Pot to the pressure setting and cook on high for 20 minutes. Use the quick release to release the pressure.
Turn the Instant Pot to saute and cook for about 15 minutes, stirring occasionally, until onions start to turn brown and much of the liquid has evaporated.
Add the garlic, sherry, beef broth, bay leaf, thyme, salt and pepper. Pressure cook on high for 10 minutes.
Use the quick release to release the pressure.
While the soup is cooking, slice the baguette into 1 inch slices.
Ladle the soup into individual oven proof crocks.
Place 1-2 slices of bread over the soup and sprinkle with about ⅛ cup of the grated Gruyere.
Place under the broiler until the cheese is melted and browned, about 2-3 minutes. Be sure to watch it under the broiler to ensure it doesn't burn. All broilers act a little different.
Notes
Use beef bone broth for the best results.
Substitute any type of onions for the yellow onions.
If using dried thyme, use half the amount called for in the recipe.
Substitute Swiss, Jarlsberg, or Emmantheler for the Gruyere if desired. They all have a great flavor and go very well with this soup.
A crusty French baguette is the best bread to use, but any crusty bread can be used. You can also toast the bread for extra crustiness.
Adjust salt to taste. Depending on the beef broth you use, it may contain more sodium than others. The recipe calls for a minimal amount of salt, but you will likely need to adjust it if using unsalted/low sodium broth.