I have this same issue. Here's a deep dive that might be useful to you. At the end, I'm going to suggest how to approach Tesla Service to get this fixed. I have reported this (and all of the following research) to Tesla for a repair. It's been a year since then, and they haven't fixed it as of this writing.
Part 1: There are two settings that control the folding of the mirrors:
Auto-fold &
Auto-fold at Location. I have discovered that when both features are off, mirrors fold as expected (never). When one uses either feature (but not both), mirrors fold and unfold as described in the manual (good). But when both features are turned on, the mirrors behave in a random fashion (bad). From my Model S 2020 manual, the
Auto-fold feature is described like this:
"You can set the mirrors to fold automatically whenever Model S is locked by touching Controls > Vehicle > Mirror Auto-Fold. The mirrors unfold automatically whenever you unlock."
And when you lock the car, the mirrors will fold. So far, so good. The
Auto-fold at Location feature is explained like this:
"Model S can automatically fold and unfold the side mirrors based on location, which saves you from having to manually position them each time you need to fold or unfold the mirrors when at a frequented place (such as narrow garages, tight parking spaces, etc.).
"To set up, Model S must be driving at a low speed (less than 3 mph/5 kph) or stopped at the location you want your vehicle to remember. Go to Controls > Vehicle > Always Fold Mirrors at this Location."
Part 2: It's important to know why these features exist and what they do to make life easier. Turning on the Auto-fold feature means that your mirrors will be tucked out of the way so that someone (or some vehicle) is less likely to bump into your car when you're parked anywhere. Turning on the Auto-fold at Location feature is great for a place you often need to drive into that is narrow (like your home garage).
Part 3: I need both features turned on. I want the mirrors to be folded when the car is locked, wherever it is (parking lot,
et cetera). My garage is narrow, so the mirrors should be folded at my home location for entering the garage
and backing out upon leaving. When both features are turned on, the mirrors fold properly when parking and locking the car (good). They fold properly when I enter my driveway (good). However, when I unlock my car in the garage, there are several modes of failure. Most times, the mirrors unfold (bad). Sometimes, only the passenger side mirror unfolds (bad). Sometimes, the mirrors remain folded, but unfold when I apply the brake to shift into reverse (bad).
Part 4: Even after reporting this to Tesla Service (December, 2021), providing lots of information, and letting them hold on to the car off and on over several months, there has been no fix. This is definitely a software issue. Someone coded up each feature, and each one worked. But no one tested them together. The Auto-fold at Location feature should take precedence, but the Auto-fold feature is interfering with that and randomly unfolding the mirrors when they should remain folded.
I'm going to speculate as to why there is no fix: This is a software issue. This is not going to be fixed at your local service center. Your service team is going to report this to the Tesla software team. That team is going to ignore the request. Your local Tesla service manager can tell a local service technician to fix a defective temperature sensor, and it will get done. But your local Tesla service manager is powerless to get the Tesla software team to address warranty issues. Does this make sense to you?
Part 5: If you're having the same issue as I describe above, here's my suggestion. Keep reporting this defect over and over. Don't accept the answer that "this is the way it's supposed to work." It isn't. Don't accept the answer "we reported it but we don't have a timeline on when it will be fixed." Insist on a timeline. Without a deadline, it will never be fixed. Don't accept the answer that this problem isn't seen that often (or that you're the only one with this problem). That doesn't matter one bit. It's a defect (let's hope under warranty for you), and it must be fixed. (Imagine if you had a defective windshield wiper motor, and they decided not to fix it because you're the only one who's had a defective windshield wiper motor.)
Document everything. You want to make sure that you preserve your records so that this will be covered under your warranty.
As of this writing, my car is in service and the mirror software defect is one of the issues that should be addressed. I will return here to report on the outcome.
Have any of you reported this failure for repair under warranty?