Peel the yellow onions and slice them into thin, even half-moons.
In a heavy-bottomed pot or Dutch oven, melt the ghee over medium-low heat.
Add the onions and a pinch of sea salt, cooking slowly for 30 to 40 minutes while stirring occasionally until they are soft and deep brown.
Add the minced garlic and thyme sprigs, sautéing for 1 minute until fragrant.
Pour in the sherry vinegar to deglaze the pot, scraping up any browned bits from the bottom.
Add the beef bone broth and black pepper, then bring to a gentle simmer for 15 minutes to meld the flavors.
While the soup simmers, toast the sourdough slice until golden and crisp.
Remove the thyme sprigs from the soup and ladle the hot liquid into an oven-safe crock.
Place the toasted sourdough on top of the soup and cover generously with the shredded Gruyere cheese.
Place the crock under a broiler for 2 to 3 minutes until the cheese is melted, golden, and bubbling.