Legal advisers that give spurious advice to our public servants should contribute the court costs when judgements go against their advice. The costs for these vexatious cases come from treasury and by default from the taxes collected.
Do this a few times and the quality will improve.