The 500 error is coming from your destination system. It looks like your request is working but the system you are requesting data from is throwing a 500 error. The hints will be in the nested exception details.
Issues like this during auth can occur when system clocks are out by too much, etc
I would contact the admin for the SMS system you are trying to send messages through and debug from there