I know I said I wouldn't post again, but I'll be nicer this time.
What I also think what's at play here is your Sales Associate also didn't know how the codes work. You didn't need to search and key the codes in one at a time, which sounds like what you were doing (or he was doing).
If you were googling for codes, all it would have taken is to click on each link/code, go to the Design Studio, and in most cases, you'd get a display like this which means the code is valid and works:
View attachment 213490
The only other message I've seen is "Sorry, John has has no more referrals, please find another referral" or something to that effect, meaning that person's code has maxed out for the quarter.
I've never seen a message that a code has expired. I just tried to load a referral link for a non-existant code, and there was no popup or error message, just the Design Studio and no referral credit. So I guess that could happen, but I think it's very rare.
Maybe there was a transcription problem between you looking for codes, and communicating them to the Sales associate who was keying them in?
I could definitely see how the codes at the top of the google search had maxed out if you were buying at the end of the quarter. But there are so many available, it's hard to believe it took you that long to find a code that wasn't maxed out. There are Tesla discount codes all over Facebook, Ebay, twitter, reddit, etc.
It's hard to re-create the past, and see exactly what was happening and why you had so much trouble finding a working code. I would guess even a worst case scenario, it would have taken no more than 5 minutes to find one that worked.
One final note -- under your proposed scenario, a new buyer would go to your site to find a code, use it, and then at some point after the referral was used, go back and find the same code (which are just first names and some numbers) and then give it a thumbs up/thumbs down rating. I'm not sure many people will care that much to re-visit the site to give the code they used a rating.
Also under your plan, any 'highly ranked" code is likely to be used multiple times until it's maxed out. Which means someone would have to take the code, have it get rejected by the Sales Associate or the Design Studio, and again, revisit your site to give it a thumbs down rating. How are you going to authenticate people as "real buyers" and not people submitting self-rankings to boost their codes to the top?
And if one code gets a single thumbs down because it's maxed out or there was some other problem with it, does one thumbs down mean you'll "expire" the code for the duration of the quarter? What if users go in and thumbs-down everyone else's code so their code floats to the top? Are you going to vet each user to find out if they're a real buyer or perhaps a code owner trying to manipulate the codes? The "ranking" thing just seems wrought with potential problems, abuse, validation, user errors, and relies on the real buyers returning to rank the exact code they used (if they even remember it).
This is why the random referral system works so well, it doesn't depend on any of those things. And if by some chance a code doesn't work, there are hundreds of others just waiting to be used, and the referrals are distributed fairly and randomly, not focused on the "most voted up code" which would basically send all the referrals to one person.