Exactly. Texas law allows the same, but you better be absolutely sure the LEO is in violation of the law if you do so. However, it does keep everyone honest.
I’ve been trying to remember the last time I heard of a Texas SWAT unit pulling a “whoops, wrong house, we meant to raid the house down the block” screwup, and I don’t think I’ve heard of one in the last ten years. I’m pretty sure 9.31 and 9.32 are why.