Hello pvardanis (and Mr. Meerkat)!
May I suggest loss = 1.0 - cos (theta_pred - theta_targ)?  This
loss is zero when theta_pred = theta_targ (or they differ by a multiple
of 360 degrees).  It is the analog on the circle of the squared error on the
real line.
Best.
K. Frank