Preheat your oven to 350°F (176°C) and line a cupcake pan with paper liners.
In a medium bowl, whisk together the flour, baking powder, and salt; set aside.
In a large mixing bowl, beat the butter, sugar, vegetable oil, and coconut extract on medium speed until the mixture is light in color and fluffy, about 3 to 4 minutes. Be sure to cream thoroughly for the best texture.
Add the eggs one at a time, mixing well after each addition. Scrape down the sides of the bowl as needed to ensure even mixing.
Add half of the dry ingredients to the wet mixture and mix until mostly combined.
Slowly pour in the milk and mix until fully incorporated. The batter may look curdled—that’s normal.
Add the remaining dry ingredients and mix until smooth and combined. Be careful not to overmix. Scrape the bowl sides as needed to incorporate all ingredients evenly.
Fill each cupcake liner about three-quarters full and bake for 13 to 15 minutes, or until a toothpick inserted in the center comes out with a few moist crumbs.
Remove the cupcakes from the oven and let cool in the pan for 2 to 3 minutes, then transfer to a wire rack to cool completely.
While the cupcakes cool, prepare the pastry cream filling. Lightly beat the egg yolks in a medium bowl and set aside.
In a large saucepan, whisk together the sugar, cornstarch, and milk until smooth.
Cook over medium-high heat, stirring constantly, until the mixture thickens and starts to bubble.
Reduce the heat to medium and simmer for 2 minutes, then remove from heat.
Gradually whisk a small amount of the hot milk mixture into the egg yolks to temper them, then slowly add the egg yolk mixture back into the saucepan.
Return the pan to the heat and bring to a gentle boil, stirring constantly. Cook for 1 to 2 minutes until thickened.
Remove from heat and stir in the butter, coconut extract, and flaked coconut. Mix until smooth, then set aside to cool to room temperature.
To make the frosting, beat the butter and shortening together in a large bowl until smooth.
Add 2 cups of powdered sugar and mix until combined and smooth.
Add the coconut extract and 1 tablespoon of water or milk, mixing well.
Gradually add the remaining powdered sugar, mixing until smooth.
Add additional water or milk as needed to reach a smooth, pipeable consistency. Set aside.
Using a cupcake corer or small knife, carefully remove the centers from the cooled cupcakes.
Fill the hollowed centers with the cooled coconut filling.
Pipe the frosting generously over the filled cupcakes and sprinkle with toasted coconut flakes.
For optional pie crust toppers, bring refrigerated pie crust to room temperature.
Roll out the crust and use a mini cutter in your desired shape to cut out toppers.
Place the toppers on a parchment-lined baking sheet and bake according to package instructions, about 450°F for 5 to 7 minutes, until golden.
Once cooled, place the pie crust toppers on the frosted cupcakes. Refrigerate cupcakes in an airtight container until ready to serve. For best freshness, consume within 2 to 3 days.