This is a throttle-by-wire scheme. There is a potentiometer connected to the accelerator pedal, inside the vehicle. Check the electrical connections, and try a plastic-safe electrical contact cleaner such as CRC QD on the potentiometer to see if it improves. You could also meter the resistance (engine off) as you move the pedal through the range.
It would also be helpful to inspect the electrical connector at the throttle motor, on the throttle body.