It wasn't a Tesla it was what I traded in for the Tesla. Carmax can definitely detect after factory body work (they flagged both the paint and welds - I did not disclose beforehand and my bodyshop didnt tell me they welded the replacement bumper so I didn't know). I took a hit in the trade in value since the car was considered repaired. I would have had to sell private party and I didnt want to do that.
I have also had regular dealers detect paint spray upon trade in. Thats a relatively simple tool that reads paint thicknesses and lots of dealers have those.
Private party wouldn't have detected anything, but I don't normally sell cars that way. So if you trade in cars, its a risk. If you normally sell private party, no worries.