In a measuring jug, combine the milk and lemon juice. Set aside for 5 minutes until slightly curdled.
Add the flour and cornflour to a food processor and pulse to combine.
Add the cold butter and pulse until the mixture resembles coarse crumbs with visible butter pieces.
Gradually add the milk mixture while pulsing until the dough just comes together.
Divide the dough into two equal discs, wrap tightly, and refrigerate for at least 1 hour.
If using fresh blueberries, gently toss them with the caster sugar and arrowroot until evenly coated.
If using frozen blueberries, thaw first, then cook in a saucepan over medium heat for 3 minutes. Stir in the sugar and arrowroot, cooking another 4 minutes until thickened. Let cool completely.
Preheat the oven to 220°C (200°C fan). Grease a 24.5 × 18 cm pie dish.
Roll out one dough disc on a lightly floured surface into a 30 cm circle. Line the pie dish and trim the edges, leaving about 1 cm overhang. Place in the freezer while preparing the lattice.
Roll out the remaining dough to about 3 mm thick and cut into 10 strips approximately 3 cm wide. Chill the strips for 30 minutes.
Spoon the blueberry filling into the prepared crust.
Arrange the pastry strips in a lattice pattern over the filling, pressing the edges to seal.
Brush the pastry with beaten egg and sprinkle generously with Demerara sugar.
Place the pie on a baking tray and bake for 20 minutes.
Reduce the oven temperature to 180°C (160°C fan) and continue baking for 30–40 minutes, or until the crust is golden and the filling is bubbling.
Allow the Blueberry Pie Recipe to cool completely before slicing. Serve with vanilla ice cream if desired.