You could have a faulty accelerator pedal and the voltage is fluctuating and causing errors. Check all wiring and plug connections both at the TB and Pedal.
P0638 is Throttle Actuator Control Range/Performance (Bank 1)
If a new TB was installed and the adaptive settings as well as the fault code were not reset, you will still have issues. Clearing the fault code only will not fix the issue once a new TB has been installed, you still need to clear and reset any adaptive settings back to a default setting for it to work correctly. One would assume this would have been done by the dealership but not a guarantee.