Preheat oven to 350°F. Grease 2 (8-inch) cake pans with butter, and dust with flour; line pan bottoms with parchment paper. Sift together flour, cocoa, baking soda, and salt into a medium bowl; set aside. Stir together buttermilk and vinegar in a measuring cup with a spout; set aside.
Combine sugar and butter in a large bowl, and beat with an electric hand mixer on medium speed until light and fluffy, about 3 minutes. Add oil, eggs, food coloring, vanilla, and buttermilk mixture, and beat on medium speed until well combined, about 1 minute. Add flour mixture, and beat on low speed until just incorporated and batter is smooth, about 1 minute.
Divide batter evenly between prepared cake pans (about 2 2/3 cups each), and smooth tops. Tap pans gently on counter to release any air bubbles.
Bake in preheated oven until cakes spring back when gently pressed and a wooden skewer inserted into center comes out clean, 26 to 28 minutes. Let cakes cool slightly in pans on a wire rack, about 10 minutes. Invert cakes onto a wire rack; let cool completely, about 1 hour and 30 minutes.
Combine cream cheese, coconut oil, and vanilla in a large bowl; beat with an electric hand mixer on medium speed until smooth, about 1 minute. Gradually beat in powdered sugar until mixture is smooth, light, and fluffy, about 2 minutes. Add finely shredded coconut, and beat until well combined, about 30 seconds.
Remove parchment paper from cakes; trim cake layers to level. Place 1 cake layer, trimmed side up, on a cake plate. Top with 1 1/4 cups frosting, and spread evenly. Stack second cake layer on top, trimmed side down. Spread remaining frosting evenly over top and sides of cake. Garnish cake with toasted coconut flakes. If frosting feels soft and warm, refrigerate cake until firm, about 30 minutes, before serving.