In a Dutch oven, melt butter over medium-high heat. Add onions, 1.5 tsp salt, and sugar. Cover and cook, stirring occasionally until onions are translucent, about 20 minutes.
Uncover, cook until liquid evaporates and browned bits form, 5-10 minutes. Reduce heat to medium, cook uncovered, stirring and scraping browned bits until onions are deeply caramelized, 30-40 minutes.
Stir in wine, scraping browned bits, cook until nearly evaporated, about 1 minute. Add beef broth, thyme, bay leaves, 3/4 tsp pepper, adjust salt. Bring to a boil, reduce to medium-low, simmer uncovered, 30 minutes.
Preheat oven to 350°F, middle rack. Toss baguette pieces with olive oil, salt, and pepper. Spread on baking sheet, bake until golden and crisp, 15-18 minutes. Remove, set aside. Increase oven to 500°F.
Remove thyme and bay leaves, season soup to taste. Divide soup among six 12-ounce oven-safe crocks on a baking sheet. Sprinkle with half the Gruyère, add croutons, top with remaining Gruyère and Parmesan.
Bake until cheese melts and soup bubbles, 5-7 minutes. Cool 5 minutes before serving.