Mr. Hegseth broke the logjam by unilaterally striking the officers’ names from the list, though it is not clear he has the legal authority to do so.

Mr. Buria told Mr. Driscoll that President Trump would not want to stand next to a Black female officer at military events, the officials said.