This is not a Texas rule, but a FED rule.
6.1.1 Note: If a pitcher is ambidextrous, the umpire shall require the pitcher to face a batter as either a left-handed pitcher or right-handed pitcher, but not both.
The umpire goofed. There is no penalty. He just doesn't allow the switch during the same batter.
Bob