The bucking happens above 2500 RPM. Because of the Swirl Control Valve code (DTC1130) The vehicle goes in to "limp mode" causing the bucking above 2500 RPM
Make sure the vacuum lines to and from the Swirl Control valve and the vacuum control switch are clear, in good shape and not leaking.
I have a post here explaining how to test the swirl control switch.
below is a link that will show you all the parts of the Swirl control system.
Let me know if you need help. I just went through this with my 2004 3.5 pathfinder
https://brentroad.com/photos/00523360.jpg