A MeshFunction isn't a object that can be projected onto a function space.
However, you can copy the information of the MeshFunction into other function that belongs to a "compatible" function space (CellFunction->DG0, VertexFnction->CG1, etc). In your case the below code should be work:
DG = FunctionSpace(mesh, "DG", 0)
local_error = CellFunction("double", mesh)
u = Function(DG)
u.vector()[:] = local_error.array()
The above code works only because in this particular case the cell order is the same as the dof order in the DG0 space (see this discussion for some referenes).
Regards!