Preheat the oven to 375°F. Place the pastry in a 9-inch deep-dish pie plate. Line with parchment paper and pie weights. Bake for 15 minutes, remove the weights, and bake another five to seven minutes.
Reduce the oven temperature to 350°F.
In a large mixing bowl, whisk together the granulated sugar, all-purpose flour, and salt.
Add the eggs and whisk until the mixture is smooth and evenly combined.
Slowly add the milk and heavy cream, whisking gently.
Stir in the melted butter, vanilla extract, and optional coconut extract.
Fold in the sweetened shredded coconut.
Place the partially baked crust on a rimmed baking sheet. Pour the custard mixture into the pie shell without overfilling.
Bake for 45 to 55 minutes, until the edges are set, the center has a slight wobble, and the coconut topping is lightly golden.
Remove from the oven and cool on a wire rack for approximately one hour.
Refrigerate for at least three hours before slicing. Garnish with whipped cream and toasted coconut if desired.