Digital PLL loses lock every time mesage crosses zero
You are having trouble because that's not a Costas loop.  A Costas loop uses demodulated data in some form to change the phase that's expected from the signal.  

You're just taking the I/Q demodulated signal and applying it to the atan2 function; that makes a sort of linearized extended phase detector, but without determining that the phase should have flipped by 180 degrees, your loop is naturally trying to follow the phase that's actually coming in.

You could make your loop into a simple Costas loop by changing the atan2 function into a multiply, and following it by a proper loop filter.