Preheat the oven. Set the oven to 400°F (200°C). Have a 10-inch cast-iron skillet and a rimmed baking sheet ready.
Caramelize the onions. Melt the butter with the olive oil in the cast-iron skillet over medium heat. Add the sliced yellow onions and cook for approximately 25 minutes, stirring frequently, until golden brown. Adjust the heat as needed to prevent burning.
Prepare the puff pastry. While the onions cook, lightly flour a work surface and roll the thawed puff pastry into a 12-inch square. Cut it into 16 equal squares, each measuring 3 inches. Refrigerate the pastry squares until ready to use.
Cook the carrots. Once the onions are golden brown, add the sliced carrots and ¼ cup water to the skillet. Cook for 5–6 minutes, stirring frequently, until the onions deepen in color and the carrots become tender-crisp.
Add the herbs and garlic. Stir in the minced garlic, chopped thyme, and rosemary. Cook for approximately 1 minute, stirring until fragrant.
Deglaze with sherry. Pour the dry sherry into the skillet. Scrape the browned bits from the bottom with a wooden spoon and cook for approximately 45 seconds, until the liquid evaporates.
Add the flour. Sprinkle the flour over the onion mixture. Stir continuously for approximately 1 minute, until the flour becomes lightly browned and forms a paste with the vegetables.
Prepare the gravy. Gradually pour in the beef broth, stirring to incorporate the flour mixture. Bring to a simmer over medium heat and cook for approximately 5 minutes, stirring frequently, until the gravy thickens.
Add the roast beef. Stir in the bite-sized pieces of cooked beef roast along with its reserved au jus sauce. Season with kosher salt and black pepper.
Add the Gruyère. Remove the skillet from the heat. Sprinkle the shredded Gruyère cheese evenly over the hot beef and onion filling.
Prepare the egg wash. In a small bowl, whisk the egg with the remaining 1 tablespoon water until evenly combined.
Arrange the puff pastry. Brush the pastry squares with the egg wash. Place them over the hot filling, overlapping the squares slightly to cover the entire surface.
Bake the pot pie. Place the cast-iron skillet on a rimmed baking sheet. Bake in the preheated oven for 25–30 minutes, until the puff pastry is golden brown and the filling is bubbling.
Rest and serve. Remove the skillet from the oven and allow the pot pie to rest for 10 minutes. Garnish with additional fresh thyme leaves and serve warm.