Hello again Brad and thank you for the additional information. Since you apparently had an offer letter and not a term contract, the employer, under both NY and Texas law could let you go for any, or no, reason and with no notice or warning unless doing so would violate their company policies or your offer letter or was motivated because you are a member of a protected class under employment discrimination
laws. That is because both States are employment "at will" states.
That said, the issue here really is the sign on bonus recoupment issue. If the agreement said that the sign on bonus would be repayable under any circumstances if your employment ended prior to two years, then technically they could demand repayment. However, you might be able to successfully argue detrimental reliance under an implied contract theory for your actions in quitting your previous job and ending your lease and thereby offset the demand for the bonus repayment. Unfortunately neither NY nor Texas have an implied covenant of good faith and fair dealing in employment agreements, so that won't help you.
Ultimately, I think that a court in NY would take jurisdiction over this issue since that is where you were when you entered into the agreement and where you worked from. So, I would encourage you to take all of the paperwork that you have to a local employment law
attorney and have them look over it. They might suggest that they write a letter to the employer and try to negotiate this bonus repayment away, using some argument related to what I mentioned.
It really isn't ethical what they did, but the legal argument is not as strong on your behalf. But you still should explore it.
Please let me know if you have any specific follow up questions. I would be glad to assist you further if I can.