Preheat your oven to 180°C (350°F). In a large bowl, season the diced beef with salt and pepper, then dust it lightly with the plain flour. This helps to create a nice sear on the beef and will also thicken the gravy as it cooks.
Heat 1 tablespoon of olive oil in a heavy-bottomed pot or Dutch oven over medium-high heat. Brown the beef in batches to avoid overcrowding the pan, cooking each batch for 2-3 minutes until the pieces are golden brown. Remove the beef and set it aside on a plate.
In the same pot, reduce the heat to medium and add the remaining olive oil. Sauté the onions, garlic, and diced carrot (if using) for about 5 minutes until softened and lightly golden. Stir in the tomato paste and cook for an additional 2 minutes to enhance its rich flavour.
Return the browned beef to the pot and add the beer, stirring to scrape up any browned bits from the bottom. Let the mixture simmer for 5 minutes, allowing the alcohol to cook off slightly, while the beer infuses its deep, malty flavour into the beef.
Pour in the beef stock and add the thyme. Stir to combine, then bring the mixture to a gentle boil. Once boiling, reduce the heat to low, cover the pot, and let it simmer for 1 to 1.5 hours, or until the beef is tender and the sauce has thickened. Stir occasionally and check the seasoning, adding more salt and pepper if necessary.
While the beef is simmering, prepare the pie crust. Roll out the shortcrust pastry and line the base of a 9-inch pie dish. Trim the edges, leaving a slight overhang, and prick the base with a fork. Blind bake the crust for 10 minutes to prevent it from becoming soggy when filled.
Once the beef mixture is done and has thickened, allow it to cool slightly before pouring it into the pre-baked pie shell. The filling should be rich and hearty, with just enough gravy to keep the meat moist without making the pie overly liquid.
Roll out the puff pastry and carefully place it over the top of the pie, pressing the edges to seal. Trim off any excess pastry and crimp the edges with a fork for a decorative finish. Brush the top of the pie with the beaten egg, then cut a small slit in the centre to allow steam to escape. Bake in the preheated oven for 20-25 minutes, or until the pastry is golden brown and crisp.