I would also ask why, in the first place, was it that you replaced the accelerator pedal position sensor. What symptoms, on whose advice?
Considering that the accelerator pedal position sensor was just changed, my first guess would be that it was not correctly adjusted to have the correct electronic values for maximum and or minimum travel, and when the control module sees an "out of range" signal, it [correctly] disables the throttle.
This is ONLY to be used to report flooding, spam, advertising and problematic (harassing, abusive or crude) posts.