Judge slams police for defying a court order