Bummer of a night for you, sorry.

You got a ticket, not a faulty? It's only a brake light, he could have been nice and given you the faulty and a chance to fix it first.

I would go to court and show that you got it fixed. Most likely the Judge would then toss the ticket for you.

The guy sold the car out from under you? He should have contacted you first. Not a nice thing to do.

You did have a heck of a day. I hope things turn around for you!