This is traditional French onion soup but served in small cups.
In a large heavy pot, melt 5 tablespoons butter over medium heat. Add onions and cook until softened, stirring occasionally, about 15 minutes. Add the salt, pepper, and sugar; continue to cook, stirring occasionally, until onions are deep golden brown and caramelized, reducing heat slightly if onions seem to be browning too quickly, 35 to 45 minutes more.
Add wine and raise heat to high. Cook until almost all liquid has evaporated, 8 to 10 minutes.
Add broth and bay leaves and three sprigs thyme to pot with onions. Bring to a boil, reduce to a simmer, and cook, uncovered, until broth is thickened and flavorful, 20 to 30 minutes. Taste and adjust seasoning
Preheat oven to 425. Place baguette slices on a rimmed baking sheet and toast in oven until crisp and dry about 5 minutes but keep an eye on them. Turn over and sprinkle a good amount of cheese on each slice and return to oven until melted.
Meanwhile, place a drop of sherry into each cup. Remove bay leaves and thyme from soup; Spoon hot soup in cups. Cover with melted cheese toasts and garnish with fresh thyme leaves. Serve immediately.