Indeed, it’s an affirmative defence:
Generally, a person may use force, but not deadly force, to protect property. There are, however, some important exceptions. Under Penal Code 9.42, deadly force may be used to protect land or property when a person reasonably believes that deadly force is immediately necessary to:
- prevent arson, burglary, robbery, aggravated robbery, theft at night, or criminal mischief during nighttime;
- prevent someone fleeing with property after committing burglary, robbery, aggravated robbery, or theft during the nighttime.
However, the person must also be able to show that he reasonably believed that the land or property could not be protected or recovered by any other means or that the use of non-deadly force would expose him or another to a substantial risk of death or serious bodily injury.
IANAL, but I think it would be a pretty high bar to meet to say that calling the police wasn’t another means to recover their property.
It’s quite wild, though, that if you’re caught stealing something at night in Texas, the law seems to read that someone can track you down and if they reasonably think you can get away before the cops can catch you, and that they wouldn’t be able to find you afterwards (maybe no video or pics of the burglar), then the Texas law is apparently just fine with the robber being killed as “self-defence”.