Melt butter in a large skillet over medium heat. Add the onions and spread them out. Increase heat to medium-high. Add the brown sugar, 1/4 teaspoon of the salt, and the black pepper. Stir. Cover skillet (if you don’t have a cover for it, use a large baking sheet or a big piece of aluminum foil). Continue to cook over medium-high heat, stirring occasionally, until well-browned and very soft, 10-11 minutes.
Meanwhile, preheat the broiler. Then, pour the beef stock into a large pot or Dutch oven over high heat. Add 1/2 of the teaspoon of salt and the thyme. Cover and bring to a boil. Reduce to a simmer.
While the stock is heating, put bread slices in a single layer on a baking sheet and put it under the broiler until tops of bread slices are toasted. Remove toast from broiler. Flip slices over. Top each with some of the cheese. Return it to under the broiler until cheese is melted. Remove from oven.
When the onions are well-browned, add the wine to them. Stir it until most of the wine has evaporated. Add the onions and wine to the hot stock. Taste and add salt and pepper if needed.
Ladle soup into bowls. Top each serving with a slice of cheese toast.