Prepare the pan: Preheat oven to 350°F (175°C). Line a 9x13-inch baking pan with parchment paper, allowing edges to overhang for easy removal. Set aside. Checkpoint: Your pan is ready when parchment is smooth and secure.
Make the crust dough: In a large mixing bowl, combine 1 3/4 cups all-purpose flour, 1/2 cup granulated sugar, and 1/2 teaspoon salt. Whisk together for 30 seconds until evenly mixed.
Cut in the butter: Add 3/4 cup cold unsalted butter (cut into small cubes) to the flour mixture. Using a pastry cutter, two knives, or your fingertips, work the butter into the flour for 3–5 minutes until the mixture resembles coarse breadcrumbs with pea-sized butter pieces still visible. This creates flakiness.
Add wet ingredients: Create a small well in the center of the flour mixture. Add 1 egg yolk and 2 tablespoons ice water. Stir gently with a fork for 1–2 minutes, just until the dough begins to come together. Do not overmix. Checkpoint: The dough should be slightly crumbly but hold together when pressed.
Press into pan: Transfer dough to the prepared baking pan. Using your fingertips, press the mixture firmly and evenly across the entire bottom of the pan, creating an even 1/4-inch layer. Make sure corners and edges are filled.
Bake the crust: Place the pan in the preheated 350°F oven on the middle rack. Bake for 12–15 minutes until the edges are light golden brown and the crust feels set when lightly touched (it will continue to cook). The crust should smell toasty. Remove from oven and set aside to cool for 5 minutes while you prepare the filling.
Heat the milk: In a medium saucepan, combine 2 cups whole milk and 1 cup unsweetened coconut milk. Place over medium-high heat and stir occasionally for 4–5 minutes until the mixture is steaming and small bubbles form around the edges (do not boil). Remove from heat and set aside.
Prepare the egg mixture: In a separate medium mixing bowl, add 5 egg yolks. Add 1/2 cup granulated sugar, 1/4 cup cornstarch, and 1/4 teaspoon salt. Whisk vigorously for 2–3 minutes until the mixture is pale, thick, and ribbon-like. This lightens the yolks and prevents curdling.
Temper the eggs (critical step): Slowly pour about 1/2 cup of the hot milk mixture into the egg mixture while whisking constantly for 1–2 minutes. This gradual warming prevents scrambling. Continue whisking and slowly add another 1/2 cup of milk. Then pour the entire egg mixture back into the saucepan with the remaining milk, whisking constantly for 30 seconds. Checkpoint: You should have a smooth, uniform mixture with no lumps or streaks.
Cook the custard: Place the saucepan over medium heat. Stir constantly with a wooden spoon or whisk for 6–8 minutes. The mixture will gradually thicken. Watch for it to reach 170°F on an instant-read thermometer, or until it coats the back of a spoon and a line drawn through it stays clear. You'll see large, slow bubbles breaking the surface. Do not skip this heating step — it cooks the eggs safely.
Finish the filling: Remove from heat. Add 3 tablespoons unsalted butter, 2 teaspoons vanilla extract, and 1 1/2 cups shredded unsweetened coconut. Stir constantly for 1–2 minutes until the butter is melted and everything is evenly combined. The filling should smell deeply of coconut and vanilla.
Pour and spread: Carefully pour the hot custard filling over the cooled crust. Use an offset spatula or the back of a spoon to gently spread it into an even layer, filling all corners. Work quickly while warm.
Chill the filling: Press plastic wrap or parchment paper directly onto the surface of the custard to prevent a skin from forming. This is important. Refrigerate the entire pan for 2–3 hours until the custard is completely set and chilled. You can make the bars to this point up to 1 day ahead.
Make whipped cream topping: In a clean, cold mixing bowl, add 1 cup heavy whipping cream, 2 tablespoons granulated sugar, and 1/2 teaspoon vanilla extract. Using an electric mixer on medium-high speed (or a whisk by hand), beat for 2–4 minutes until stiff peaks form. When you lift the beaters, the cream should stand up in firm, glossy peaks. Do not overbeat or it will turn to butter.
Add topping: Remove plastic wrap from chilled bars. Spread the whipped cream evenly over the custard layer with an offset spatula, or pipe it decoratively using a pastry bag with a large round or fluted tip. Work gently to avoid disturbing the custard.
Garnish: Sprinkle the entire surface with 1/2 cup shredded toasted coconut and 2 tablespoons unsweetened coconut flakes. You can also add a light dusting of shredded coconut to each corner for visual appeal.
Final chill and cut: Return the pan to the refrigerator for at least 30 minutes before cutting. This helps the whipped cream set slightly and makes cutting cleaner. Using a sharp knife dipped in hot water and wiped clean between cuts, slice the bars into 12–16 squares, depending on desired size. Serve immediately or cover loosely and refrigerate for up to 4 hours.