Melt butter in a large stockpot over medium heat. Cook and stir onions, garlic, thyme, salt, and pepper in hot butter until onions are soft and brown, about 30 minutes.
2
Pour in red wine and sherry; bring to a boil. Reduce heat to low and simmer until you can no longer smell alcohol cooking off, about 15 minutes.
3
Meanwhile, preheat the oven to 350 degrees F (175 degrees C).