Prepare the Baking Pan: Butter a 9×13-inch baking pan or a comparable pan and set it aside.
Combine the Dry Ingredients: Add the flour, granulated sugar, instant yeast, and kosher salt to the bowl of a stand mixer fitted with the dough hook, then mix until the ingredients are evenly combined.
Warm the Milk: Place the whole milk and melted butter in a small pot over medium-low heat and warm until the butter has melted and the mixture is lukewarm; if it becomes too hot, let it stand at room temperature until it cools before proceeding so the yeast can rise properly.
Add the Liquid: Pour the lukewarm milk and butter mixture into the dry ingredients.
Beat the Eggs: In a small bowl, whisk the large egg and two egg yolks together until well combined, then add them to the flour mixture.
Knead the Dough: Mix the dough on medium speed for about 5 to 7 minutes, until it becomes smooth and elastic; the dough will be quite wet, which is expected.
Prepare the Dough for Rising: Rub a medium bowl with about 1 teaspoon of oil, such as olive oil, then transfer the dough into the bowl and cover it with a clean kitchen towel.
First Rise: Let the dough rise for 30 to 40 minutes; alternatively, cover the bowl tightly with a lid or plastic wrap and refrigerate the dough for 12 to 24 hours.
Melt the Butter for the Onions: Add 1 tablespoon butter and 1 tablespoon olive oil to a wide-rimmed pan over medium heat and warm until the butter melts.
Soften the Onions: Add the thinly sliced onions, chopped thyme, and 1 teaspoon kosher salt, stirring until the onions are completely coated in the butter and oil.
Cover and Cook: Reduce the heat to medium-low, add 1 to 2 tablespoons of water, and cover the pan for 15 minutes to help the onions soften.
Caramelize the Onions: Remove the lid and continue cooking, stirring every few minutes, for about 25 to 45 minutes, until the onions are deeply softened and caramelized.
Cool the Onions: Remove the caramelized onions from the heat and transfer them to a small bowl.
Divide the Dough: Divide the risen dough into 15 equal pieces, weighing them if desired so each portion is approximately 70 grams.
Portion the Filling: Divide the caramelized onions into 15 equal portions, approximately 1 packed ½ tablespoons each, then top each portion with about ½ tablespoon of the grated Gruyère, using half of the total cheese for the filling.
Flatten the Dough: Roll one piece of dough into a thin, pancake-like round and place one portion of the onion and cheese mixture in the center.
Seal the Roll: Bring the edges of the dough together over the filling, enclosing the onions and cheese completely, then pinch the edges firmly together to secure the filling.
Arrange the Rolls: Place the filled dough ball seam-side down in the buttered baking pan, then repeat the filling and sealing process with the remaining dough portions.
Proof the Rolls: Cover the pan with a clean dish towel and let the rolls rise for about 1 to 1½ hours, until they have doubled in size and look puffy and supple.
Adjust the Overnight Dough Rise: If the dough was refrigerated overnight, assemble the rolls directly from the refrigerator and allow them to rise after shaping; because the dough will be cold, the second rise may take about 1½ hours.
Preheat the Oven: Preheat the oven to 350°F.
Apply the Egg Wash: Brush the tops of the proofed rolls with the beaten egg.
Add the Cheese Topping: Sprinkle the remaining 3 ounces of grated Gruyère evenly over the rolls.
Add Fresh Thyme: Place one sprig of fresh thyme on top of each roll.
Bake the Rolls: Transfer the pan to the 350°F oven and bake for about 25 to 30 minutes, until the rolls are golden brown.