The general solution is:
Pendulum 1
$$\theta_1(t)=A_1\,\sin(\omega_1\,t)+B_1\,\cos(\omega_1\,t)$$
Pendulum 2
$$\theta_2(t)=A_2\,\sin(\omega_2\,t)+B_2\,\cos(\omega_2\,t)$$
obtain
$$\theta_1(t)-\theta_2(t)=A_1\,\sin(\omega_1\,t)-A_2\,\sin(\omega_2\,t)+
B_1\,\cos(\omega_1\,t)-B_2\,\cos(\omega_2\,t)\tag 1$$
and with:
$$\sin(x)-\sin(y)=2\,\sin \left( \frac{x-y}{2} \right) \cos \left( \frac{x+y}{2}
\right)\\
\cos(x)-\cos(y)=-2\,\sin \left( \frac{x+y}{2} \right) \sin \left( \frac{x-y}{2}
\right)
$$
Eq. (1)
$$\theta_1(t)-\theta_2(t)=2\,A_1\,A_2\,\sin \left( \frac{t\,(\omega_1-\omega_2)}{2} \right) \cos \left( \frac{t\,(\omega_1+\omega_2)}{2}
\right)\\
-2\,B_1\,B_2\,\sin \left( \frac{t\,(\omega_1+\omega_2)}{2} \right) \sin \left( \frac{t\,(\omega_1-\omega_2)}{2}
\right)$$
thus
$\theta_1(t)=\theta_2(t)~$ only if $~\omega_1=\omega_2~$