The Duke of Sussex could be subjected to harassment if his visa records were disclosed, the US government previously told a court.