WEST PALM BEACH, Fla. — The international finance consultant accused of illegally entering President Trump’s Mar-a-Lago resort in Florida knew several days before she traveled to the United States that the gala she had paid to attend had been canceled, federal prosecutors said on Monday.

The disclosure raised new questions about the intentions of the woman, Yujing Zhang, 33, who told the authorities she had come to attend a United Nations Chinese Friendship Association event associated with a gala that night. Instant messages recovered from one of her cellphones revealed that Ms. Zhang had been told even before she left Shanghai that the Mar-a-Lago event had been canceled, Rolando Garcia, an assistant United States attorney, told the court.

Ms. Zhang had texted back, Mr. Garcia said, “wanting to know why the event was canceled.”

Magistrate Judge William Matthewman of the Federal District Court in West Palm Beach rejected Ms. Zhang’s bid to be released on bail, concluding that there was a substantial risk she could flee the country if released before her trial on charges of entering restricted property and making false statements to a federal agent.

“It does appear to the court that Ms. Zhang was up to something nefarious,” the judge said.

But prosecutors also revealed that they were no longer certain that a thumb drive Ms. Zhang was carrying when she entered the resort on March 30 was infected with “malicious malware,” as they had earlier claimed.