Preheat the oven to 350ºF and prepare 2 cupcake pans with liners for a total of 24 cupcakes.
In the bowl of a stand mixer or large mixing bowl combine the sugar and lemon zest and mix on high for 2 minutes.
Pour in the sour cream, oil, eggs, lemon juice, milk, and vanilla extract and mix on high for 2 minutes.
Add in the flour, baking powder, salt, and xanthan gum (if using) and mix on low until just combined. Scrape down the sides of the bowl when necessary.
Divide the batter evenly into the prepared cupcake pans. Fill approximately ⅔ – ¾ full and bake for 16-20 minutes or until a toothpick inserted in the center comes with just a few moist little crumbs.
Allow the cupcakes to cool in the cupcake pan for 10 minutes and then remove them to a cooling rack to fully cool.
In the bowl of a stand mixer with the paddle attachment cream the butter, cream cheese, and lemon zest on high speed until light and fluffy. Approximately 10 minutes.
Add in the icing sugar, lemon juice, and salt and mix on low until combined.
Turn the mixer up to high and let mix for 5 minutes until smooth and fluffy. Scrape the sides of the bowl when necessary. Allow the frosting to chill for 30 minutes before using.
Fit a piping bag with a Wilton 1M piping tip. Fill the bag with the prepared buttercream.
On a fully cooled cupcake, start in the center, and with even pressure begin to pipe the frosting in a circular motion moving out and then up. As you move the frosting up to build the swirl slightly twist your wrist to create the ruffle effect if desired. At the top of the swirl, release the pressure and pull off the piping bag.
Top with sprinkles and enjoy!
