If $\theta$ lies between $\pi/4$ and $3\pi/4$ (or between $-3\pi/4$ and $-\pi/4$) then $\cos(2\theta)$ is negative and will not have a square root. So the top and bottom leaves of the lemniscate ought not to be there. Maybe you should rewrite the equation as $r = \sqrt{2\cos(2\theta)}$ and see what the calculator makes of that version.