In a large pot, bring salted water to a boil. Add the pasta and cook according to package instructions until al dente. Drain and set aside.
In a large skillet, heat the butter and olive oil over medium heat. Add the sliced onions and cook, stirring frequently, until they are softened and caramelized, about 15-20 minutes. Sprinkle the sugar over the onions during the last few minutes of cooking to enhance caramelization.
Stir in the minced garlic and cook for an additional 1-2 minutes until fragrant.
Pour in the broth and bring to a simmer. Cook for about 5 minutes, allowing the flavors to meld.
Stir in the heavy cream, and adjust the seasoning with salt and black pepper to taste. Allow the sauce to simmer for another 5 minutes until slightly thickened.
Add the cooked pasta to the skillet, tossing to coat it with the sauce. If desired, add a little pasta water to achieve your preferred sauce consistency.
Stir in the Gruyère and Parmesan cheese until melted and well combined.
Transfer the pasta to a serving bowl and garnish with fresh thyme if using. Enjoy!