When someone calls you a lemon they are basically saying in a nicer way that you're useless or imperfect or a dud.
The person calling you a lemon doesn't like you and is trying to let you know they don't like you in a nicer way.
Lemon refers to something sour that is not working correctly or something that is imperfect a dud, useless etc.
That's why we call used cars that are in bad shape or don't run correctly a Lemon because it's imperfect, useless etc.
So that's one reason we have Lemon Laws in place for people who happen to buy a car that turns out to be a lemon even though most people buy used cars as is.