Let's reduce the question to Canadian lawyers in immigration practice. Bad advice can cause loss of residency, lifetime ban and more. What's your recourse?
If the lawyer was negligent, you can sue
Note that negligence requires considerably more than just being wrong . Professional advice (including legal advice) requires assessment of risks and strategies and advising the client of these so they can make informed choices about their options. There is plenty of scope to make mistakes, however, a lawyer who does what a reasonable lawyer (not an expert lawyer) should do has not been negligent.
You cannot sue for anything done or said by the lawyer in court - this is a public policy thing to stop disappointed litigants from suing their lawyer if they lose.