A nonlinear Bismut–Elworthy formula for HJB equations with quadratic Hamiltonian in Banach spaces