In the days after the shooting, a lawyer for Officer Yanez said his client had been “reacting to the presence of a gun” when he opened fire and that Mr. Castile had not followed the officer’s commands.