Thinly slice your white onions and begin caramelizing by heating 3 of your 5 tbsp of butter in a large soup pot. Set heat to low-medium.
Pre heat your oven to 400 degrees.
Sauté your onions for about 8-10 minutes until softened. Add in 1/4c red wine, continue sautéing and stirring frequently until wine is absorbed. Add in another 1/4c of red wine and continue sautéing until absorbed. This whole process of caramelizing onions should take about 30 minutes. Add the other 2 tbsp of butter if you need more to caramelize - the onions should not be dry as you do not want them to burn! Patience here!
Add in fresh thyme leaves, garlic, and cayenne and stir. Sauté for another 5-7 minutes. Your onions should be really cooked down and deeply caramelized (this process takes time and patience). Keep your heat low and make sure to not char or burn your onions.
Add in the last of your wine (1/4c), heavy cream, beef broth, worcestershire sauce, and the pasta. Stir well. Leave uncovered and continue stirring frequently until liquid is absorbed and pasta is al dente (about 10-11 minutes).
Add in 3/4c of your gruyere cheese and mix well. Taste test and add more salt or cheese to your liking. Test your pasta's doneness as this will determine your baking step.
Transfer your pasta to an oven safe baking dish. Top with more gruyere cheese.
If your pasta is fully cooked & already soft, cover with cheese and BROIL for 3 minutes. Remove from oven. If your pasta is al dente (slightly undercooked), bake for 8-10 minutes and then broil for 2 minutes at the end.
Remove from oven, top with more cheese if you please, fresh time, and serve hot! Enjoy!