Likely is a wiring issue, did the new throttle body come with a shirt link cable to the original loom? The connectors in the original housing can become very tarnished and won't maintain a reliable connection. If there is a link loom with tge new body suggest cutting off the in line connection blocks and connect the wires directly by some method.
On ours, there were also tarnished connections in a big black connection box under a headlight on the passenger side, worth opening them up and inspecting all the pins, as I traced the throttle wiring through there when fault finding the same issue.
A new throttle actuator and making good connections fixed it.