Judges accused of running 'flawed' wasted costs system