My 2020 ranger used to have the same issues when cold (rough shifting, slight bucking) and also a weird one that I haven't seen mentioned; I have always let my vehicles warm up until the RPMs dropped to the normal idling speed, it used to take my ranger 10-15 mins of idling to drop the rpms in the morning, im not exaggerating. I took it to the Ford dealer and they reprogrammed the PCM, helped a little bit with the rough shifting, but it was still there and the idling problem was as well. I just had my Ford Performance tune installed and boom! Issues are gone. Truck warms up after a minute or two and shifting is normal now when cold.