Melt 3 tablespoons of the unsalted butter in a large Dutch oven or heavy-bottomed skillet over medium-low heat. Add the sliced yellow onions and 1/2 teaspoon kosher salt, then cook for 35 to 40 minutes, stirring every 5 minutes, until deeply browned and jammy.
Stir the fresh thyme leaves and low-sodium beef broth into the caramelized onions, scraping up any browned bits from the bottom of the pan. Simmer for 2 to 3 minutes until the liquid reduces into a glossy glaze, then remove from heat.
Place the peeled Yukon Gold potato chunks in a 5-quart stockpot, cover with cold water by 1 inch, and stir in 1 teaspoon kosher salt. Bring to a boil over high heat, reduce to a steady simmer, and cook for 15 to 18 minutes until fork-tender. Drain well, return the potatoes to the hot pot, and let them steam-dry over low heat for 60 seconds.
Remove the pot from heat and mash the dried potatoes until smooth. Fold in the remaining 2 tablespoons butter, warmed heavy cream, room-temperature sour cream, and black pepper until velvety.
Stir in the freshly shredded Gruyère cheese and two-thirds of the caramelized onions until the cheese melts completely into the warm mash. Taste and adjust salt if needed.
Transfer the mashed potatoes to a warm serving bowl, spoon the remaining caramelized onions over the center, scatter with chopped fresh chives, and serve hot.