A totaled vehicle would be considered a business casualty loss and the insurance proceeds would be deemed the sales price. It makes no difference whether you purchased the vehicle or financed it and the insurance proceeds were sent to the legal owner. And, remember it is depreciation allowed (i.e., actually deducted from your tax return) or allowable (i.e., you did not take a depreciation deduction but could have). So, you could easily have some recapture in this situation. Or you might have a 1231 loss if the adjusted basis > the insurance proceeds.
I have not had any personal dealings with Lemon Law repurchases for business clients. I do not know how the statute is worded. If you are seriously considering a Lemon Law pursuit, I would consult with your lawyer to determine how the statute reads. It may very well be that a Lemon Law claim voids the purchase contract. If that were the case, I would not take any depreciation on the vehicle, including amending a prior year's return to eliminate the deduction. But I would have to give this more thought than a simple five-minute typed reply in an area that I have not researched.