Whisk the cornstarch and water together until all the cornstarch has dissolved.
Combine cornstarch mixture, raspberries, granulated sugar, and lemon juice in a medium saucepan set over medium heat.
Using a silicone spatula, stir the mixture, mashing the raspberries as they begin to thaw and soften.
Bring to a boil and let it boil for 5 full minutes, stirring occasionally.
Remove pan from heat and stir in vanilla extract.
Allow the raspberry filling to cool at room temperature for 10–15 minutes, then transfer it to a bowl or container and place it in the refrigerator for at least 4 hours and up to 1 week.
To fill cake: Spread a thin layer of buttercream on your cake layers, pipe a buttercream dam around the cake layers, and spread the raspberry filling inside the buttercream border.
To fill cupcakes: Cut a circle in a cooled cupcake, remove the center, fill with raspberry filling, and press the round piece back on top.
