Since the mirror is capable of working, we know the switch is ok.
Seeing as this problem is dependent on the actual position of the mirror, leads me to believe that the problem is a broken wire inside the mirror itself.
Seeing as these a pretty pricey mirrors you will have to see if you can take it apart enough to run some new wires, or just purchase a used mirror if you can.
Yes the glass can be removed....just be careful not to break it.
NOTE: When disconnecting the wire harness connectors from the heated mirror glass terminals, note the location of each connector and its respective terminal for installation reference.