This just happened to me this evening (727/13).
Here's the situation: I'm parked at a multi-story municipal lot in Alameda CA. I'm plugged into their complimentary Chargepoint station while off running errands, and when I come back I sit in the car to make some phone calls while still plugged in. My S is backed into the space, which has a few degrees of slope running back toward some poles protecting the Chargepoint, and then the wall.
Idly browsing through the menus while on the phone, I hit the "neutral and power off" button, and sit there with my foot on the brake. Then I discover when I go to re-engage the P-brake that the switch is now momentary only- the parking brake will NOT latch. I tried it probably 30 times, between the physical switch and the screen button. The brake would not latch with the charge cable attached. As the car started rolling towards the wall as soon as I let off the footbrake, I couldn't get out of the car to release the cable- so I was stuck!
I waited there for 15 minutes, trying to kick my shoe forward far enough to wedge the wheel (couldn't); I tried to get out of the car while holding the "P" brake switch and push the car forward against the slope (also couldn't); I stopped the charging on screen, but that didn't help. Every time I tried to see if the P brake would hold, the car moved a little closer to the wall and, even worse, the way I was lined up the pole would have sheared off the charge cable (or wedged it in place)
Eventually I had to beg an octogenarian passer-by for help and coach her through disconnecting the charge cable. She nearly fell over when it finally released!
Moral of the story: DON'T hit that neutral/power off button if the car is charging, particularly on a slope. And Tesla- please fix this!!!!