In a large saucepan or Dutch oven, add butter and melt over medium heat. Add the onions and lower the heat to medium low. Add the thyme leaves and cook, stirring frequently, until the onions start to turn golden brown, about 25 minutes. Add the sherry and cook until the sherry is almost completely evaporated and the onions are brown, about 15 minutes.
Add the stocks and bring to a boil. Lower the heat to a simmer and simmer for 30 minutes. Season, to taste, with salt and pepper.
Preheat the oven to 450 degrees F.
Ladle the soup into 8 oven-proof soup bowls. Place the soup bowls on a sheet pan. Place the croutons on top of the soup, to cover. Top each bowl with 1/2 cup grated cheese. Place in the oven and cook until the cheese is golden brown and bubbly, about 10 minutes.