Make the frosting first: In a stand mixer fitted with the paddle (or with a hand mixer), beat the butter on medium speed until smooth and light, about 2–3 minutes. Add half the powdered sugar, vanilla, and a pinch of salt; mix on low until combined. Beat in the milk, then add the remaining sugar. Whip on medium-high for 3–4 minutes until fluffy. Cover and set aside at cool room temperature.
Preheat the oven to 350°F (177°C). Line 18 standard muffin cups with paper liners.
Bloom the cocoa: In a heatproof bowl, whisk the cocoa powder, espresso powder, and cinnamon with the very hot water until smooth and glossy. Let cool until just warm, 5 minutes.
Whisk the dry mix: In a large bowl, whisk together the gluten-free flour, baking powder, baking soda, and salt.
Build the wet base: In another bowl, beat the eggs and granulated sugar with a hand mixer on medium-high until paler and slightly thickened, about 2 minutes. Stream in the oil and vanilla; mix just to combine, then fold in the sour cream until smooth.
Combine: Stir the cocoa mixture into the wet base. Add the dry ingredients in two additions, mixing gently after each just until no dry streaks remain. Do not overmix.
Rest the batter for 8–10 minutes to hydrate the gluten-free flour. This improves the crumb without overmixing.
Fill the liners about 2/3 full using a scoop. Bake for 16–18 minutes, rotating the pan once halfway, until the tops spring back lightly and a toothpick inserted in the center comes out with a few moist crumbs.
Cool the cupcakes in the pan for 5 minutes, then transfer to a wire rack to cool completely before frosting.
Frost generously with the vanilla buttercream using a piping bag or an offset spatula. Add sprinkles if you like.