In a small bowl, sprinkle gelatin over 1/4 cup cold water. Let stand for 5 minutes. In a medium saucepan, whisk together coconut milk, sugar, gelatin mixture, coconut extract, and salt. Bring to a boil over medium heat, 3 to 4 minutes. Meanwhile, in a medium bowl, whisk egg yolks with cornstarch until combined.
Slowly whisk one-fourth of the hot-milk mixture into egg yolks; return to saucepan. Cook, whisking constantly, until the mixture returns to a boil, about 1 minute. Stir in shredded coconut. Transfer to a large bowl; let stand 15 minutes.
Pour filling into the prepared crust. Refrigerate until set, at least 4 hours, and up to overnight. Spread whipped cream on top; garnish with toasted coconut, if desired.