Cook the pasta according to package instructions until al dente. Drain and set aside.
In a large skillet, heat the olive oil over medium heat. Add the sliced onions and cook, stirring frequently, until they are caramelized and golden brown, about 15-20 minutes.
Add the minced garlic to the skillet and cook for an additional 1-2 minutes until fragrant.
Pour in the beef broth and add the dried thyme, balsamic vinegar, salt, and pepper. Bring the mixture to a simmer and let it cook for about 5 minutes.
Stir in the cooked pasta, mixing well to combine.
Preheat your oven broiler. Transfer the pasta mixture to an oven-safe dish. Top with the shredded Gruyère and grated Parmesan cheese.
Broil in the oven for 3-5 minutes, or until the cheese is bubbly and golden brown.
Remove from the oven and let it cool for a couple of minutes. Garnish with chopped parsley before serving.