I claim that whenever $M$ is a paracompact connected smooth manifold and $C$ is a closed subset of $M$, there is a smooth function $f:M\rightarrow[0,\infty)$ where $C=f^{-1}[\{0\}]$ and where all derivatives of $f$ are zero on $C$.

Let $M$ be a paracompact $C^\infty$-manifold with at most countably many components. Then there exists a sequence of compact sets $(K_n)_{n=0}^\infty$ where $M=\bigcup_{n=0}^\infty K_n$ and where
$K_n\subseteq K_n^\circ$. Therefore, for each $n$, there is a smooth function
$f_n:M\rightarrow[0,1]$ where $f_n[K_n]=\{0\}$ but where $f_n[K_{n+1}^c]=\{1\}$.

In this case, set $f=1+\sum_{n=0}^\infty f_n$. Then $f:M\rightarrow[1,\infty)$ is a smooth function where $f^{-1}[[1,r]]$ is compact for each $r<\infty$.

Now, if $M$ is a paracompact smooth manifold and $C$ is a closed subset of $M$, then set
$U=M\setminus C$. Then $U$ is a paracompact smooth manifold with at most countably many components. Therefore, there is some function $f:U\rightarrow[1,\infty)$ where $f^{-1}[[1,r]]$ is compact whenever $r<\infty$. Therefore, extend $f$ to a continuous function $f_0:M\rightarrow[1,\infty]$ by setting $g(c)=\infty$ for $c\in C$. Let $g:M\rightarrow[0,1]$ be the function defined by letting $g(x)=1/f_0(x)$. Then $g$ is a continuous function that is smooth on the set $U$.

Theorem: Let $M$ be a paracompact connected manifold, and let $g:M\rightarrow\mathbb{R}$ is a continuous function that is smooth on the set $\{x\in M:g(x)\neq 0\}$. Then there is a smooth bijective function $H:\mathbb{R}\rightarrow\mathbb{R}$ where $H(0)=0$, $H\circ g$ is smooth everywhere, and where all higher order derivatives of $H\circ g$ are zero on the set $\{x\in M:g(x)=0\}$.

I gave a proof of the above result in my other answer here.

By applying the above result to the function $g$ and setting $h=H\circ g$, we obtain $C=h^{-1}[\{0\}]$ and we may conclude that all derivatives of all orders of $h$ are zero on the set $C$.