Your post is a little unclear on who was unlicensed. If the second person you hired to fix the work of the first contractor was unlicensed, that will not preclude you from suing the first contractor. But it might be something the first contractor raises as a defense to your claims. If I were the contractor I would certainly point out that the guy who did the repairs was operating illegally and does not have sufficient knowledge, skill or qualifications to determine what is bad construction.
But that does not mean you can't bring a small claims case. You could also file a complaint with the CSLB.
An unlicensed contractor can't do any work over $500 and, as my collegues have pointed out, you will be able to make a demand for a refund from him. I don't know how much you paid but, keep in mind that you are limited to a $10,000 claim in small claims court.
An important lesson here is to verify that you are hiring a licensed contractor. If you have any issues, such as this, then you would be able to make a claim against their bond.