High Court ruling could put legal complaints staff jobs at risk