Preheat oven to 350 degrees (F).: When your oven reaches 350 degrees F you will smell a faint warmth and the rack should feel evenly heated when you briefly place a hand near the open door, the heat should be steady not blasting. This temperature ensures even rising and a tender crumb without overbrowning, which matters because too hot an oven sets the exterior before the interior has a chance to rise properly. A common mistake is not letting the oven fully preheat, which can cause uneven texture and undercooked centers; always give it time to stabilize and use an oven thermometer if yours runs hot or cool.
Line 2 cupcake tins with paper liners; set aside. In the bowl of a stand mixer fitted with the paddle attachment, or in a large bowl using a handheld electric mixer, beat the butter, vanilla extract, lemon extract, sugar, and lemon zest on medium-speed until light and fluffy, about 2 minutes. Add in the eggs, one at a time, beating well after each addition. On low speed, beat in the sour cream, then the milk. Turn mixer off. Add in 3 and 1/4 cups of the cake flour, baking powder, baking soda, and salt. Use a fork to lightly toss the dry ingredients together. Using a rubber spatula, gently fold the dry ingredients into the batter, mixing just until combined. Be sure not to over mix here or your cupcakes will be dense! Set aside. In a small bowl combine the remaining 3 tablespoons of flour with the raspberries; toss to coat. Using a rubber spatula, gently fold the raspberries and any excess flour into the batter, stirring just until combined. Spoon batter into prepared cupcake tins (filling each mold 3/4 of the way). Bake one pan at a time, for about 22 minutes, or until a cupcake tester inserted in the center of a cupcake comes out clean, or with just a few moist crumbs attached. Cool in the pan for 10 minutes then transfer cupcakes to a cooling rack. Cool completely before frosting.: The liners should sit snugly in each mold with no air pockets, which prevents batter from leaking and gives the cupcakes a clean edge as they bake. You will notice the liners soften slightly as they fill with batter, and they make removing cupcakes simple. If you skip liners you risk sticking and tearing when you try to extract cupcakes, so use them for best presentation and easy cleanup.
In the bowl of a stand-mixer fitted with the paddle attachment, or in a large bowl using an electric handheld mixer, beat the cream cheese, butter, and lemon extract on medium-high speed until completely smooth; about 2 minutes. Reduce the speed to low and gradually add the sifted confectioners' sugar. Add in the lemon juice and zest. Once incorporated, increase speed to medium-high and beat for 1-2 minutes. Once the cupcakes have completely cooled, spread or pipe the frosting on top of the cupcakes. Decorate with fresh raspberries and a lemon slice, if desired.: As you cream the butter and sugar , the mixture should lighten in color and increase in volume; you will hear a gentle whir from the mixer and see tiny air pockets appear, which create lift. The lemon zest will release fragrant oils that make the kitchen smell bright and citrusy. Overbeating at high speed can cause the mixture to become greasy, while underbeating leaves a dense batter, so aim for a pale, airy texture about two minutes on medium speed.
Cupcakes are best the day they are made, but will keep, covered and stored in the fridge, for 3 days. Bring to room temperature before serving.: As you incorporate each egg , the batter will become smoother and more cohesive, with a glossy sheen that indicates proper emulsification. Adding eggs slowly prevents curdling and ensures an even structure. A common error is dumping eggs in all at once, which can separate the mixture; if that happens, reduce speed and mix gently until the batter comes back together.
Beat in the sour cream on low speed, then the milk: The sour cream adds silkiness and tang, and mixing it in on low keeps the batter from splattering while preserving trapped air. Once the sour cream is incorporated, the batter will feel slightly thicker, and the addition of milk brings it to a spoonable consistency. Mixing too vigorously can deflate your batter, so fold or beat on low for a smooth, unified texture.
Add 3 and 1/4 cups cake flour, baking powder, baking soda, and salt: The dry ingredients should be combined so you have a uniform powder; when you fold them in gently the batter will change from glossy to slightly thicker and soft. The cake flour keeps the crumb fine, while baking powder and baking soda provide lift. Overmixing here will develop gluten and make cupcakes tough, so stop as soon as the streaks disappear.
Fold dry ingredients into the batter just until combined: The batter will show no visible streaks of flour but will still be light and aerated, and you should use wide folding motions to preserve air. You will see the batter move like thick ribbon when you lift the spatula, which is a good indicator to stop. A typical mistake is vigorous stirring that knocks out air and results in dense cupcakes, so fold gently and steadily.
Toss remaining 3 tablespoons of flour with raspberries: Coating the raspberries in a bit of flour helps prevent them from sinking and bleeding into the batter, and the raspberries will look slightly dusted after tossing. This step keeps the berries suspended and helps maintain pretty pockets of fruit. If you skip this the berries may sink to the bottom or release juice that discolors the cupcake interior.
Fold raspberries and excess flour into the batter until combined: You should see specks of red throughout the batter without large clumps, and the raspberries should be distributed evenly. Folding gently protects the berries from breaking apart, so you still have intact fruit when baked. Overmixing at this stage will mash the raspberries and create streaks, so be gentle and stop when distribution looks even.
Spoon batter into prepared cupcake tins filling each mold 3/4 of the way: Filling to about 3/4 capacity gives room for the cupcakes to rise and develop domed tops without spilling over. The batter should be smooth and thick, holding its shape slightly when spooned. If you underfill you get small cupcakes, and if you overfill they can overflow and bake unevenly, so be measured and consistent with each cup.
Bake one pan at a time for about 22 minutes or until a tester comes out clean: As they bake you will notice a sweet, citrus aroma filling the kitchen and the tops will turn a pale golden shade. The cupcakes are done when a tester inserted into the center comes out clean or with a few moist crumbs attached. Baking multiple pans at once can change heat circulation and cause uneven results; for consistent texture bake single pans unless you know your oven handles multiple pans well.
Cool in the pan for 10 minutes then transfer to a cooling rack: Letting them rest in the pan allows the structure to set so they do not collapse when moved, and after 10 minutes the cupcakes should slide out easily onto a cooling rack. You will see steam dissipate and the tops stop feeling warm when they are ready to move. Moving them too soon can cause them to tear or sink, so wait the full ten minutes before transferring.
Cool completely before frosting: The cupcakes must be fully cooled, not warm to the touch, so the frosting does not melt or slide off; this can take up to an hour depending on room temperature. Cooling also helps flavors settle and avoids a runny frosting finish. Frosting warm cupcakes is a common mistake that results in collapsed swirls and messy presentation.
Beat cream cheese, butter, and lemon extract until completely smooth: The frosting base should be silky and lump free, and mixing at medium high speed for about two minutes achieves a uniform texture and glossy finish. You will smell bright lemon and tangy cream cheese as you blend. If the cream cheese is not very soft you will get lumps, so ensure proper softness before starting.
Reduce speed and gradually add sifted confectioners' sugar, then lemon juice and zest: Adding the confectioners' sugar slowly prevents a powdered sugar cloud and helps you control sweetness. Once the sugar is incorporated, the lemon juice and zest brighten the mix and balance the sweetness. If the frosting becomes too thin add more sifted sugar; if too stiff add a teaspoon of milk or lemon juice to adjust consistency.
Increase speed and beat for 1 to 2 minutes until fluffy: Whipping the frosting at a higher speed aerates it so it becomes light and pipeable, and you will notice a change to a loftier texture. This step gives the frosting body for neat piping and appearance. Be careful not to overbeat for too long, which can make it too airy and unstable for piping detailed decorations.
Spread or pipe frosting onto completely cooled cupcakes and decorate: The frosting should hold peaks when piped and feel smooth on the tongue, and adding a fresh raspberry or lemon slice makes each cupcake visually appealing. Work with a steady hand and keep designs simple for the best results. Decorating too early or on warm cupcakes will cause the frosting to slide and lose shape.
Store covered in the fridge for up to 3 days and bring to room temperature before serving: Chilling helps the frosting set and keeps the cupcakes fresh, but serve them at room temperature for optimal texture and flavor, about 20 to 30 minutes out of the fridge. If left out too long they may dry, so refrigerate if storing beyond a day. A common oversight is leaving them uncovered which leads to a dry surface and loss of freshness.