This has been knowknown for some time, including the higher-dimensional problem, in $\mathbb{R}^n$, that if $f\in C^k$ where $k<n$ then the set of critical points need not be of zero measure.
H. Whitney, A function not constant on a connected set of its critical points A function not constant on a connected set of its critical points, Duke Math. J. 1 (1935), 514-517.