I posted an ideaSome thoughts on your problem. If $u$ is so smooth that $Du$ has a well defined trace, e.g., $u\in H^s$ for $s>3/2$, then you could flatten the surface by a $C^1$ change of variables and reduce to the case $S=\{x_1=0\}$. Then the assumption on $Du$ becomes $Du=(D_1u,0,...,0)$ which means the derivatives of the trace are zero a.e. on the coordinate plane $S$, and hence $u$ is constant there. This seems to rough to be interesting, sowork fine for Sobolev functions and maybe for other functional spaces.
For $BV$ functions I decidedam a bit skeptical; you have a well defined $L^1$ trace for $u$, but in what sense would you formulate your assumption on $Du$ restricted to delete it$S$?