To make the crust, freeze unsalted butter until firm, about 15 minutes. Meanwhile, whisk flour, black pepper, and salt in a large bowl.
Place a box grater over a large plate and grate butter on the large holes. Transfer the butter to the dry ingredients and use your fingers to toss the butter in the flour until evenly coated, breaking up any clumps.
Drizzle ice water over the butter-flour mixture. Use a dough blender to lightly mix. Use your hands as a ball begins to form, but do not overwork the dough.
Turn the dough out on a large piece of plastic wrap. Use the palm of your hand to quickly gather and press the mound into a thick disk. Wrap in the plastic wrap and refrigerate for at least 1 hour.
While the dough chills, begin making filling. Halve and thinly slice yellow onions. Strip the leaves from fresh thyme sprigs.
Melt butter in a large skillet over medium heat. Add onions, half of the thyme leaves, salt, and black pepper. Cook, stirring frequently. Reduce heat if onions start to burn. Add water, a tablespoon at a time, to the pan if onions ever appear dry. Reduce onions by over half until they are very soft and a deep golden brown, 45-60 minutes.
Grate Gruyère cheese and set aside.
Pour wine over the caramelized onions. Scrape up any browned bits on the bottom of the pan and continue to stir until the wine has evaporated, about 1 minute. Remove from eh heat and stir in vinegar.
Arrange a rack in the middle of the oven and heat to 400° F.
Unwrap the dough and place on a lightly-floured surface. Roll into a 12” wide disk and carefully transfer onto a baking sheet lined with parchment paper.
Spread Dijon mustard evenly onto the dough, leaving a 1 1/2”-2” border. Sprinkle half of the cheese onto the mustard, then spoon the caramelized onions onto the cheese.
Cut the dough border ever 2” and begin to fold edges toward the center of the disk. Sprinkle the remaining cheese on top.
Bake until the crust is golden and the cheese has melted, about 35 minutes. Let the gazette cool for 5-10 minutes before serving. Cut into wedges to serve.