FOR THE SOUP: Adjust oven rack to lower-middle position and heat oven to 400 degrees. Spray the inside of heavy bottomed large (at least 7 quart) Dutch oven with nonstick cooking spray. Place butter in pot and add onions and 1 teaspoon salt. Cook, covered, 1 hour (onions will be moist and slightly reduced in volume). Remove pot from over and stir onions, scraping bottom and sides of pot. Return pot to oven with lid slightly ajar and continue to cook until onions are very soft and golden brown, 1 1/2 to 1 3/4 hours longer, stirring onions and scraping bottom and side of pot after 1 hour.
Carefully remove pot from oven and place over medium-high heat. Using oven mitts to handle pot, cook onions, stirring frequently and scraping bottom and sides of pot until liquid evaporates and onions brown, 15 to 20 minutes, reduce heat to medium if onions are browning too quickly. Continue to cook, stirring frequently, until pot bottom is coated with dark crust, 6 to 8 minutes, adjusting heat as necessary. (Scrape any fond that collects on spoon back into onions.) Stir in 1/4 cup water, scraping pot bottom to loosen crust, and cook until water evaporates and pot bottom has formed another dark crust, 6 to 8 minutes. Repeat process of deglazing 2 or 3 more time, until onions are very dark brown. Stir in sherry and cook, stirring frequently, until sherry evaporates, about 5 minutes.
Stir in broths, 2 cups water, thyme, bay leaf, and 1/2 teaspoon salt, scraping any final bits of browned crust on bottom and sides of pot. Increase heat to high and bring to simmer. Reduce heat to low, cover, and simmer 30 minutes. Remove and discard herbs, then season with salt and pepper.
TO SERVE: Adjust oven rack 6 inches from broiler element and heat broiler. Set individual broiler-safe crocks on baking sheet and fill each with about 1 3/4 cups soup. Top each bowl with 1 or 2 toasted bagette slices (do not overlap) and sprinkle evenly with gruyere. Broil until cheese is melted an bubbly around edges, 3 to 5 minutes. Let cool 5 minutes before serving.