Preheat your oven to 375°F (190°C).
In a skillet, sauté the onions and garlic until translucent, about 5 minutes.
Add the shredded corned beef to the skillet and mix with the sautéed onions and garlic.
Pour in the beef broth and Worcestershire sauce, then let simmer for about 10 minutes.
Stir in the mashed potatoes, parsley, and pepper until well combined, then remove from heat.
Roll out one pie crust and fit it into a pie dish, then pour in the corned beef and potato filling.
Cover the filling with the second pie crust, sealing the edges well. Cut slits for steam to escape.
Brush the top crust with beaten egg for a golden finish.
Bake the pie in the preheated oven for 35 to 40 minutes or until the crust is golden brown.
Remove the pie from the oven and allow it to cool for 10 minutes before slicing.