That’s because today’s transmissions are heavily computer controlled. They depend on a clean electrical signal to operate properly. If the battery’s getting a little iffy, it could easily cause erratic shifts or poor gear engagements, even though the starter seems to crank properly when you turn the key.
To speak with someone about your specific problem or to make an appointment for your car or truck, find your local auto repair.