The Transportation Security Administration defended its officers’ treatment of a transgender woman on Tuesday, a day after she says she was harassed and held for 40 minutes while passing through security in Orlando, Fla., causing her to miss a flight.

The transgender woman, Shadi Petosky, said Tuesday in an interview that T.S.A. officers at Orlando International Airport calibrated the full-body scanner for a woman, and the device flagged what officers called an “anomaly” in the groin area. Ms. Petosky, a writer and producer who had been traveling to Minneapolis on American Airlines, said that the officers did not appear to know what to do once the scanner flagged her even though she had explained that she was transgender.

“The T.S.A. agents were kind of arguing with each other about process,” she said.

One officer insisted that she be rescreened, telling her to “get back in the machine as a man or it was going to be a problem,” Ms. Petosky said, but another officer said that she could not be rescanned. Instead, she said she was held in a screening room for 40 minutes and told not to use her phone, while T.S.A. officials discussed what to do. During that time, she said, she was patted down twice and her luggage was searched.

In an email on Tuesday, a spokesman for the agency, Mike England, said that its officers handled the situation according to policy.