Preheat your oven according to the pie crust instructions. Fit the crust into a 9-inch pie dish and prick the base lightly with a fork. Blind-bake with pie weights if necessary until golden and crisp. Allow the crust to cool completely.
In a saucepan, whisk together the whole milk, coconut milk, sugar, and cornstarch. Continue whisking until the cornstarch dissolves completely. This step helps prevent lumps from forming during cooking.
Place the saucepan over medium heat and cook, stirring continuously. Once the mixture thickens and begins bubbling gently, cook for another minute. Remove the pan from the heat and stir in the chocolate chips, butter, and vanilla.
Pour the chocolate filling into the cooled pie crust. Spread it evenly with a spatula. Let it cool slightly while you prepare the coconut layer.
In another saucepan, whisk together the coconut milk, whole milk, sugar, and cornstarch. Stir until smooth. Heat over medium heat, whisking constantly, until the mixture becomes thick and pudding-like.
Remove the saucepan from the heat and stir in the vanilla extract. Continue mixing until the filling looks smooth and glossy. Avoid leaving the mixture unattended because coconut pudding can thicken quickly.
Carefully spread the coconut mixture over the chocolate filling. Work gently to maintain distinct layers. Smooth the top with a spatula, then allow the pie to cool.
Cover the pie loosely once it has cooled sufficiently. Refrigerate for at least four hours, or until both layers are completely set. For the cleanest slices, allow additional chilling time if needed.
Pour the chilled whipping cream into a clean mixing bowl. Add powdered sugar and vanilla extract. Beat until soft to medium peaks form, creating a light and fluffy topping.
Spread or pipe the whipped cream over the chilled pie. Sprinkle toasted coconut flakes and chocolate shavings on top if desired. Slice with a sharp knife, wiping the blade between cuts for neat layers.