Put the coconut milk and butter in a medium saucepan over medium-low heat, stirring gently to melt the butter and heat the milk.
Whisk together the sugar, cornstarch and 2 tablespoons water in a separate bowl to create a thick paste. Gently whisk into the milk and increase the heat to medium. Cook, stirring often, until thick and bubbly, 10 to 12 minutes.
Remove from the heat and stir in the vanilla extract. Let cool to room temperature, then transfer to a bowl and cover with plastic wrap, pressing the wrap directly against the surface. Refrigerate until set, 3 to 4 hours.
Beat the whipping cream with an electric mixer until stiff peaks form.
Arrange a layer of half of the banana slices on the bottom of a 9-inch pie dish. Add a layer of half the pineapple followed by half of the coconut pudding and a layer of half of the wafers. Top with some whipped cream and repeat to make a second layer.
Top with the remaining whipped cream and the toasted coconut flakes. Cover and refrigerate for at least 8 hours or up to overnight before serving.