Place the sliced onions, butter, sugar, and salt in the bottom of a 6-quart slow cooker. Stir to coat the onions evenly.
Cover and cook on high for 7 hours, stirring occasionally if possible, until the onions are soft, deeply browned, and caramelized.
Add the beef broth, sherry, thyme sprigs, and pepper to taste. Stir gently, then cover and cook on high for an additional 1 hour to allow the flavors to meld.
When ready to serve, ladle the soup into oven-safe bowls. Top each bowl with slices of bread or croutons.
Place sliced Gruyère cheese on top of the bread. For a melted, bubbly topping, broil the bowls in the oven for 2–4 minutes until the cheese is golden and melted.
Carefully remove from the oven and serve hot.
Enjoy!