Peel and slice the potatoes and boil them in salted water for 10 minutes until parboiled. Drain and put to one side.
In a hot pan, sear the beef until well browned, then remove from the pan. Cook the onions, thyme and garlic until softened and add the beef.
Pour in the stock, the tomato ketchup and a splash of red wine and allow most of the moisture to boil away. Make sure the mixture is not too runny.
Preheat the oven to 200C/400F/Gas 6. Lay the sliced potatoes on the bottom circle of pastry leaving a 3.5cm/1½in margin around the edge.
Season the potato slices as you layer them on top of the pastry - you should end up with a layer of potatoes about 2.5cm/1in thick. Now spoon the moist beef and onion mix over the top and spread it out. If you have reduced it enough, the juices will not run off the edges.
Lay the other circle of pastry on top and crimp the edges well.
Brush liberally with egg wash and score any pattern you like into the pastry. Cut a tiny hole in the top to allow steam to escape and bake for 30 minutes.