Preheat oven to 180°C and line a 12-cup muffin tin with cupcake liners.
Rub lemon zest and granulated sugar together until mixture resembles moist sand.
In a mixing bowl, combine cake flour, lemon sugar, chopped pistachios, baking powder, and sea salt.
Add cubed butter to dry ingredients and mix on low speed for 3 minutes until mixture is coarse.
In a separate bowl, whisk sour cream, milk, vegetable oil, egg, vanilla extract, and lemon juice.
Pour wet mixture into dry ingredients and mix briefly, scraping the bowl, then mix until just combined.
Divide batter evenly among liners, filling each three-quarters full.
Bake for 15–20 minutes or until a toothpick inserted comes out with a few moist crumbs.
Cool cupcakes in the pan on a wire rack for 5 minutes, then transfer to the rack to cool completely.
Cook raspberries, sugar, and lemon juice in a saucepan over medium heat, mashing and stirring until bubbling and bright red, about 10–12 minutes.
Whisk cornstarch with water and stir into raspberry mixture; cook 1–2 more minutes until thickened; cool completely.
In a stand mixer, cream butter until smooth.
Add powdered sugar and mix until incorporated.
Add heavy cream, lemon juice, and lemon zest; beat on high speed for 2–3 minutes until light and fluffy.
Core center of each cooled cupcake and spoon raspberry filling into the cavity.
Pipe buttercream around the filled center and top with additional raspberry filling.
Decorate with chopped pistachios and fresh raspberries.