$$\mathbf{v}=d\mathbf{r}/dt=R( -\sin(\theta)d\theta/dt, \cos(\theta)d\theta/dt)=R\omega(-\sin(\theta), \cos(\theta))$$
Now, it’s differentiation equals in textbook
$$\mathbf{a}=d\mathbf{v}/dt= R (-d\omega/dt \sin(\theta)-\omega^2 cos(\theta), d\omega/dt\cos(\theta)-\omega^2 \sin(\theta))$$
I am not getting is that from where did we get $- \omega^2 \sin \theta - \omega ^2 \cos \theta$.
What I got is
$$- R w^2 \cos ^2( \theta) \quad , \quad R w^2 \sin^2(\theta)$$
$$\frac{d(-R\omega \sin(\theta))}{dt}=-R\frac{d(\omega sin(\theta))}{dt}$$ according to product rule and chain rule,
$$\frac{d(\omega \sin(\theta))}{dt}=\frac{d\omega}{dt}\sin(\theta)+\omega (\frac{d\theta}{dt}\cos(\theta))=\frac{d\omega}{dt}\sin(\theta)+\omega^2\cos(\theta)$$
so that $$\frac{d(-R\omega \sin(\theta))}{dt}=-R\frac{d\omega}{dt}\sin(\theta)-R\omega^2\cos(\theta)$$
so the problem with your solution is that you forgot to apply chain rule to $\sin(\theta)$.