Here's the situation: if you fail the judicial examination and want to practice in a law firm, if your financial conditions permit, that's ok, because the general law firm doesn't pay interns or only give them a certain living allowance. You can use your time in the law firm to learn more theories and get in touch with practical cases, which will help you accumulate experience and prepare for the judicial examination.
If your financial conditions do not allow, I suggest you pass the judicial examination before considering the law firm.
Supplement: You can go directly to the law firm and ask them if they need it on the spot, or if anyone is recruiting.
Good luck.