It's as OK as it is OK for courts to lie to citizens, as they do every day.
btw: I family cases I have actually heard a judge say “it’s ok and legal for social workers to lie to clients. Clients that are taxpaying, that are citizens, and parents.
Court authorized lying and deceit done upon the citizenry.