Preheat the oven to 350°F (175°C). Butter two 8-inch (or 9-inch) round cake pans, making sure to coat the sides and bottom. Then dust them with cocoa powder instead of flour; this helps the cake release easily and keeps the color deep red. Tap out any excess.
Sift and mix dry ingredients. In a medium bowl, sift together the gluten-free flour, cocoa powder, baking powder, baking soda, and salt. Whisk to fully combine and set aside.
Cream butter and sugar. In a stand mixer fitted with the paddle attachment (or using a hand mixer), beat the butter and sugar together on medium speed until light and creamy; about 3 minutes. It should be pale and fluffy.
Add eggs one at a time. Crack in one egg, beat until incorporated, then repeat. The batter may look a little curdled after the second egg; don’t worry, that’s normal. Keep mixing until it smooths out again.
Mix in remaining wet ingredients. Add the oil, buttermilk, vinegar, vanilla, and red food coloring. Start mixing on low to prevent splashes, then increase to medium speed. Beat until fully combined and smooth.
Add the dry ingredients. With the mixer on low, add the flour mixture in two additions. Mix just until combined. It’s okay if there are a few small lumps; over-mixing can lead to a dense cake.
Divide and bake. Pour the batter evenly between your prepared cake pans. Smooth the tops with a spatula and place on the same oven rack if possible. Bake for 25–30 minutes, or until a toothpick inserted in the center comes out clean.
Cool completely. Let the cakes rest in the pans for 10 minutes, then carefully turn them out onto wire racks. Cool completely, about 1-2 hours, before frosting