I would wager that there is some interesting history on Texas joining the Union and in Texas having a right to defend itself from invasion.
This should be an interesting court case to see play out. A “Solomon-like” final court decision on appeal would likely “split the baby” and say Texas is unique unlike any other state, and can use is powers (not taken away by the US federal Constitution) to defend itself from an invasion, even if that invasion is because of federal public policy.
The predominant legal theory regarding Texas’ special status is that the original agreements made upon entry to the US were rendered moot by the agreements made by all Confederate states after the Civil War.
That said we are basically in a post constitutional America where political might makes right so who knows how it plays out.