So just to clarify, replacing the throttle body and pedal sensor got rid of the P0123 code, then it ran fine, now it's having this new issue? Have you scanned it for codes again to see what (if any) codes it's currently throwing?
Make sure you have that pedal sensor plugged in tight. On mine the connection was slightly loose and occasionally the red lighting bolt would come on, the engine would lose power, and then I would have to pull to the side of the road. When I would wiggle the brake pedal, it would have power again. I found out it was the connector itself and it was just somewhat loose enough to lose connection.