TX law does not require him to be in danger. TX law does allow the use of deadly force if he reasonably believes that there is a robbery and the person(s) is getting away with the property even if it is not his own
What he did was probably legal except that TX law specifically states that there is no protection from prosecution if an innocent person was hit. In this case an innocent person was hit.