The police department should be legally compelled to tell the judge about this, then they should be held in breach of contract. This will not happen, of course, and our trust in our institutions and our belief that our society is based on anything other than raw power will take another fully-rationally-justified blow.
That is to say: any contract which includes such a clause can't bind you to do something illegal, just because you signed it.
It's generally illegal to lie to a court, particularly when under oath.
What do you even do when you have conflicting constitutional obligations...
Well, that's the premise behind many aspects of our justice system. No justice system at all accomplishes it better than any justice system at all, without other considerations, so it's clearly not the entire premise behind the whole of our justice system.
(I guess the more complicated answer is that there are lots of legal cases determining how to balance the two sides in such conflicts)