Preheat oven to 350°F (175°C) and grease your cake pans thoroughly.
Line the bottoms with parchment paper to prevent sticking.
In a bowl, sift together flour, cornstarch, baking powder, baking soda, and salt.
In a large bowl, beat butter, oil, and sugar until light, creamy, and fluffy.
Add eggs one at a time, mixing well after each addition.
Mix in lemon zest and vanilla extract to enhance flavor.
Add milk, yogurt, and lemon juice, blending until smooth.
Gradually fold the dry ingredients into the wet mixture in two parts.
Mix gently until just combined to keep the batter light.
Toss raspberries with flour to prevent sinking, then gently fold them into the batter.
Divide batter evenly between prepared pans and smooth the tops.
Tap pans lightly on the counter to remove air bubbles.
Bake for 35–40 minutes or until a toothpick inserted in the center comes out clean.
Remove cakes from oven and let them cool in pans for 15 minutes.
Transfer to a cooling rack and allow to cool completely before frosting.
For frosting, beat butter until smooth and creamy.
Add powdered sugar gradually and mix until combined.
Add cream cheese (optional), lemon juice, zest, and vanilla.
Beat until fluffy and spreadable.
Level cake layers if needed for even stacking.
Spread frosting over the first layer, then place the second layer on top.
Frost the top and sides evenly using an offset spatula.
Chill slightly before slicing for clean cuts.