The department needs to fulfill its promise to the student. If the student was promised an RA-ship, they are owed an RA-ship. And if the student didn’t agree to be a TA, they cannot be “told they are now a TA” without their explicit consent. Moreover, if the student refuses to be a TA, which they 100% have a right to do, that does not release the department from its earlier commitment to give the student an RA-ship.
That being said, organizations — even university departments — will sometimes behave in an unethical and even illegal manner. “Can” they do it, and get away with it? That depends on the situation, the level of resistance offered by the students subjected to this behavior, and the norms of the institution and country where this is taking place.
To be clear, the behavior is more than just “underhanded”. It is a clear attempt to renege on a formal promise made (in writing, I assume) to the student, about something material that would clearly heavily factor in to the student’s decision to attend this graduate program, and which could significantly affect their chances to do well in the program once there.
My suggestion to the student is to seek help from their local graduate student union, the university ombuds office, or other available resources. The department’s behavior is not acceptable. Hopefully with a modest intervention by responsible adults, the department’s administrators will be made to see the error of their ways and find more acceptable ways to solve their TA shortage.