Mr. Cantú said in the meandering interview that writing an account of a Latino who hunted down other Latinos for a living wasn’t what he had in mind when he joined the Border Patrol at age 23 as a graduate of American University. He said he had expected to do the job for a few years to gain on-the-ground experience before going into diplomacy or law school, hoping to specialize in immigration issues.

Javier Zamora, 28, a poet who emigrated without authorization from El Salvador to the United States at the age of 9, said he understood where some of the critics of Mr. Cantú were coming from, especially those who point out that the perspective of Mr. Cantú, a United States citizen, stands in contrast to those of millions of Latinos at risk of deportation in the country.

“The book resembles veteran writing and the dilemma that poses: Would you rather read a book by an Iraqi or something by an Iraq war veteran?” asked Mr. Zamora, author of the acclaimed 2017 poetry collection “Unaccompanied.” “I go for the Iraqi writer.”

Still, Mr. Zamora, who now lives in California and is at risk of being forced to leave the United States after the Trump administration reversed policies that had allowed nearly 200,000 Salvadorans to live in the country, said he appreciated much of Mr. Cantú’s book, especially passages where he writes about the mental toll of his work, describing nightmares and grinding his teeth at night.

“It’s that internal space of the mind that he describes that I think is valuable,” said Mr. Zamora. “I find it hard to read nonfiction about the border because of the trauma it brings back, but this book isn’t quite like that. It shows how the border is anything but black and white, but just very, very gray.”

Still, other writers, including some who spent much of their lives in fear of immigration agents, are less charitable in their assessments of Mr. Cantú and his book.

“Cantú is a white-passing man who has never been undocumented,” said Sonia Guiñansaca, 29, a poet brought to New York at age 5 from Ecuador to join her parents. She spent more than two decades living illegally in the United States before obtaining documents allowing her to remain in the country.