Check for poor contact of the accelerator pedal position sensor connector.
Is there poor contact of accelerator pedal position sensor connector?
Repair the poor contact of accelerator pedal position sensor connector.
Replace the accelerator pedal.