Prep the pan and oven: Heat oven to 350°F (175°C).
Line a 12-cup muffin pan with paper liners.
Whisk dry ingredients: In a bowl, whisk flour, baking powder, baking soda, and salt. Set aside.
Cream fats and sugars: In a large bowl, beat butter, oil, granulated sugar, and brown sugar on medium-high until fluffy, about 2–3 minutes.
Add eggs and flavor: Beat in eggs one at a time, then mix in vanilla and coconut extract. Scrape the bowl.
Alternate dry and coconut milk: On low speed, add half the dry mix, then coconut milk, then the remaining dry mix.
Mix just until combined.
Fold in coconut: Gently fold in shredded coconut. The batter should be creamy, not runny.
Fill and bake: Divide batter among liners, about 2/3 full. Bake 16–20 minutes, until tops spring back and a toothpick comes out clean with a few moist crumbs.
Cool completely: Let cupcakes cool in the pan 5 minutes, then transfer to a rack.
Toast the topping: Spread shredded coconut on a sheet pan and toast at 325°F (165°C) for 4–6 minutes, stirring once, until lightly golden.
Cool.
Make the frosting: Beat cream cheese and butter on medium until smooth and creamy, 1–2 minutes. Add 2 1/2 cups powdered sugar, vanilla, coconut extract (if using), and salt. Beat on low to combine, then on medium until fluffy, 1–2 minutes.
Add more sugar to thicken if needed.
Frost and finish: Pipe or spread frosting onto cooled cupcakes. Sprinkle with toasted coconut.