  We prove a higher-dimensional Chevalley restriction theorem for orthogonal
groups, which was conjectured by Chen and Ng\^{o} for reductive groups. In
characteristic $p>2$, we also prove a weaker statement. In characteristic $0$,
the theorem implies that the categorical quotient of a commuting scheme by the
diagonal adjoint action of the group is integral and normal. As applications,
we deduce some trace identities and a certain multiplicative property of the
Pfaffian over an arbitrary commutative algebra.
