Preheat the oven to 200c/400f. Unroll the pastry and line a 24cm (diameter) pie tin with the pastry. Cut off any excess pastry and pinch the edges to make a bit of a pattern on the crust. Use a fork to make holes all over the pastry in the base of the dish.
Cover the pastry with baking parchment, then pour a cup of dried beans on top (this will hold the pastry in place whilst you 'blind bake' it). Place in the oven for 10 minutes, then carefully pour out and discard the baking beans (or save for future 'blind baking'). Remove the baking parchment, and place the pastry back in the oven for another 5 minutes. Then take out of the oven and put to one side.
Now make the filling. Add the chicken, carrots, potatoes, salt, pepper, thyme and stock to a large saucepan.
Bring to the boil and allow to simmer for 15 minutes and then turn off the heat and stir in the shredded ham.
Take another large sauce pan and add in the butter and onions. Heat on medium and cook the onion for about 5-6 minutes until soft. Add in the flour and mix it into the onions and butter using a balloon whisk. It should form into a creamy paste (or roux). Allow the roux to cook for a minute whilst stirring with your whisk, then add in a ladle of the stock from the chicken broth (try to get mostly stock - not the chicken/veggies). Use the whisk to stir the broth into the mixture. Repeat this until you have ladled out most of the stock from the chicken pan (leaving the chicken and veggies behind). Then pour in the milk. Heat through whilst stirring with the whisk. The sauce should thicken as it's heating.
Once the sauce is almost at boiling (don't let it boil) add in the chicken, ham and veggies. Bring back to almost boiling and add in half the lemon juice. Give it a stir and taste. Add the rest of the lemon juice if needed. Season with salt and pepper.
Spoon the mixture into the prepared pastry until approx 1cm from the top (you may not need all of it, but if you have any leftovers, it makes great soup!).
Mix the cheddar, panko and black pepper. Sprinkle on top of the chicken mixture, then sprinkle on the shredded ham.
Place back in the oven for 15-20 minutes until the the top is golden brown and the cheese melted. Take out of the oven and decorate with a few sprigs of fresh thyme, then serve with green veg.