I'm going to go out on a limb and guess that when you park the car, you pull up the hand (park) brake, shift from drive straight to park and then take your foot off the foot brake and the car moves slightly as it transfers the weight of the car from the foot brakes to, in your case, the transmission rather than the park brake.
Most people do.
When you do this, you're usually putting the weight of the car onto a small lever engaging notches on the drive shaft
in the transmission, not the hand brake. The hand brake's designed to hold the car, the lever isn't, it's there just-in-case.
Take a look at http://auto.howstuffworks.com/automatic-transmission5.htm to see how flimsy this part is.
- To fix the problem, you'll probably have to get this part in your transmission replaced. Fortunately it's the least significant part of the transmission so don't let them shaft you just because it's part of an automatic transmission.
- To fix what caused the problem, you need your hand brake / park brake adjusted at the handle. You'll probably find that it adjusts at the other end (inside the rear wheel hubs) whenever you reverse.
For what it's worth, to avoid doing this damage to automatic transmissions whenever I'm stuck in one, I shift to Neutral then take my foot off the foot brake, then the car moves as it's weight shifts from the foot brake to the park brake which I often haven't pulled hard enough. Only when, in neutral, the car is stationary without the foot brake do I put it in park.
In Australia, it became illegal a couple of years ago to not be in the driver's seat when the engine's running. My understanding is that this was because, when the engine's running, sometimes older Automatic transmissions damaged in this way can shift out of Park. This is believed to be what has happened when you see unoccupied cars reversing in circles on "wildest police video" programs on TV. I also heard of some Borg-Warner automatic transmissions fitted to 80s model Ford Falcons (common in Australia), 70s model German saloons, which were particularly prone to Park failing to hold the car on a slope. I drove one for many years in a '75 BMW 528 in which some of it's other drivers developed the same habit.
Similarly, in my own car, I don't take my foot off the clutch until I've taken it off the brake without the car moving. Though the local Road & Traffic Authority regulation states "First gear if you're facing uphill, Reverse if you're facing downhill" I do the opposite because whatever damage might be done to panels will be cheaper than what would be done to the engine if the hand brake failed and it's not going to make much difference in slowing down a rolling car, especially with this one.
Mazda BA Astina V6.