The legality of Sunderland's actions will likely hinge on the terms of the players contract. I would be staggered if Sunderland didn't at least take advice and get told they had an arguable case before taking the course they have.
I should think that they will have done this in the hope that they can negotiate less liability than what they would have if his contract remained in full.