Preheat the oven to 350°F. Grease the bottom and sides of two 9-inch cake pans. Line the bottom of the pans with parchment paper, then grease the parchment paper. Flour the insides of the pans, including the parchment paper.
In a small bowl or measuring cup, stir together the milk, apple cider vinegar, food coloring, and vanilla.
In a large mixing bowl, whisk together the flour, sugar, cocoa powder, baking soda, and salt.
Pour the milk mixture into the mixing bowl, followed by the oil. Beat the mixture together with an electric mixer at high-speed, just until fully blended, about 1 minute.
Divide the batter evenly among the prepared baking pans.
Bake the cakes for 30 to 35 minutes, until a toothpick inserted into the center of each one comes out clean.
Transfer both cake layers to a cooling rack. Allow them to cool completely in the pans.
To make the frosting, first whisk together the sugar, flour, salt, non-dairy milk, and coconut milk in a small saucepan, then place it over medium heat. Heat the mixture while whisking constantly, until it comes to a simmer and thickens. It should take on a thick, pudding-like consistency. Take it off the heat as soon as it gets to this point.
Let the cooked sugar mixture cool completely in the saucepan, whisking occasionally or covering it with a sheet of plastic wrap directly in contact with the surface to prevent a skin from forming (Note 1).
Once the sugar mixture has cooled, you can finish making the frosting. Beat the butter and vanilla in a large mixing bowl using an electric mixer at high speed, until creamy, about 2 minutes.
Begin beating in the cooled sugar mixture, adding it in about five or six increments, beating each one in completely before adding more. Continue until all of the mixture has been added and the frosting is fluffy.
Invert one of the cake layers on a plate, then remove the pan. Peel off the parchment, then spread an even layer of frosting over the layer.
Carefully invert the second layer over the first, then remove it from the pan and remove the parchment paper. Distribute the frosting over the top and sides of the cake.
Allow the cake to sit for at least a few minutes for the frosting to set. Slice and serve.