Why do my power locks no longer unlock when I turn off my ignition? on 2003 Chevrolet Malibu

In addition to the doors no longer unlocking when I turn off the ignition, I also can't manually lock the doors with the power lock switch intermittently. Sometimes, if I keep trying to lock the doors 15 or 20 times, the doors will unlock rather than lock! When that happens, I have to go around the car and manually open and lock all of them. What's happening?

Asked by for the 2003 Chevrolet Malibu