Yes, get the degree (as long as you’re ok with the cost / debt burden, which you did not mention).
It’s very, very unlikely IMO that AI will take our jobs in the next 5-10 years. But I think the demand for good ML engineers will stay strong. Having a master’s in this is a big leg up, it’s hard for people to learn ML well without formal education.
Also, education is a great way to ride out the current crappy job market.