What shape must a bowl be to have a ball rolling in the bowl execute perfect simple harmonic motion?
starting with the position vector to the mass
\begin{align*}
&\mathbf{R}=\begin{bmatrix}
x(y) \\
y \\
\end{bmatrix}
\end{align*}
where $~x(y)~$ is arbitrary function and y is the generalized coordinate
from here the kinetic , potential energy
\begin{align*}
&T=\frac{m}{2}\left(x'^2+1\right)\,\dot y^2\\
&U=-m\,g\,y\\
\end{align*}
and the total energy
\begin{align*}
&E_s= \frac{m}{2}\left(x'^2+1\right)\,\dot y^2+m\,g\,y\\
\end{align*}
where $~x'=\frac{dx}{dy}$
for SHM the total energy must be (Ansatz)
\begin{align*}
&E_{\text{shm}}=\frac{m}{2}\dot{y}^2+\frac k2\,y^2
\end{align*}
\begin{align*}
&\text{with conservation of the energy }\\ & E_s=\frac{m}{2}\left(x'^2+1\right)\,\dot y^2+m\,g\,y=m\,g\,y_0\quad\Rightarrow\quad \dot y^2=-\frac{2\,g(y-y_0)}{x'^2+1}\\
& E_{shm}=\frac{m}{2}\dot{y}^2+\frac k2\,y^2=\frac k2\,y_0^2\quad\Rightarrow\quad
\dot y^2=-\frac km\,(y^2-y_0^2)
\end{align*}
and solving for $~x'^2~$ with $~y_0=0$
\begin{align*}
&\left(\frac{dx}{dy}\right)^2=\frac{2\,a}{y}-1\quad, a=\frac{\,m\,g}{k}
\end{align*}
this differential equation fulfilled the cycloid equation
\begin{align*}
&x=a\,(\varphi +\sin(\varphi))\\
&y=a\,(1 -\cos(\varphi))\\
\end{align*}
hence the shape that create SHM is cycloid
edit
for $~y_0\ne 0~$ you obtain
$$\left( {\frac {d}{dy}}x \left( y \right) \right) ^{2}=-{\frac {y}{y+
{\it y0}}}+2\,{\frac {mg}{ \left( y+{\it y0} \right) k}}-{\frac {{\it
y0}}{y+{\it y0}}}
\tag A$$
this differential equation fulfilled also the cycloid equation. solving Eq. (A) you obtain $~x=x(y)~$ the solution of the equation of motion is now
$$y(t)=y_0\,\cos\left(\omega\,t\right)\\
\omega^2=\frac km=\frac ga$$