Get out. NOW. You are a SENIOR developer. This should be an extreme warning sign:
1) As a senior developer, you are probably the most well-paid of your colleagues. However, you are being tasked with grunt work (or no work!). What does that say about your level of respect in the company, that they would rather you do nothing than to do something for the money they're paying you? It means you have lost the trust and confidence of your peers/management (not sure why, maybe it was your fault, maybe it wasn't, I can't say for certain).
2) They gave you a training project on a stack you were not familiar with and wasted 2 months of your time on it. That means that the company would rather re-train you to do tasks for which your senior-level competency is not a match, than give you tasks for which you can do the work. This means they are looking for an excuse to treat you like a junior. If you are happy being treated like a junior, then by all means, but they are not giving you the respect you deserve.
3) As a senior developer, you probably have a lot of experience. As such, you probably have a tech stack you are familiar with. The company is attempting to pull the rug out from under you by putting you on a project with a third-party client which is in a tech stack completely unrelated to the one you have built your experience a reputation on. My initial inclination is to believe that this is to build a case under which they can provide an excuse to fire you due to incompetence: "We gave him a software development task, he couldn't do it, therefore he was fired" (the fact that different tech stacks work completely differently and need to be treated in different ways being wholly irrelevant to the non-technical people in HR and the Labour Standards Board or whatever it's called in your country).
It sounds to me like your company is setting you up to fail, or to at least build an excuse to cut your pay or demote you. Get out, while you still can.