On the Lagrangian formulation of the double copy to cubic order