The cables were connected right. Its a new battery. Could it possibly be a bad throttle position sensor and does n e one know how to test one?
There are multiple throttle position sensors and they are all integrated into the Electronic Throttle Body. If there is an issue with any of them the wrench light will come on, there will be multiple DTCs, and it will be stuck in limp/idle only mode.
I would recommend checking your battery to chassis grounds with a DVOM. With the truck running and the DVOM set to DC Voltage, place one meter lead on the negative battery terminal and the other on the chassis ground bolt. The reading should be 0.2V or less. If you don’t find any issues with the grounds, your best bet it to have it professionally diagnosed so you don’t end up throwing parts at it.