i would look into this a little more, its been a while since ive done transmission work.
but any trans from any v6 4.0 should work fine. the 2wd and 4wd trans have the same gearing and lock up. you will just need to swap input shaft on trans if its from a 2wd.
It's a very hard transmission to get out of repairing inexpensively. I had never rebuilt a tranny before. Given the number of videos and manuals on the RE5R05A, I didn't feel it was difficult. The worst part was removing the tranny because I purchased the truck in an area where they salt the roads. Every nut and bolt took 4 times longer than what it should have. My cross member had to be hammered out with a sledge hammer. I had hoped this repair would be under $1000. If you've got OBDII codes related to the transmission, you'll need a new valve body (almost $1000 at Nissan). A master rebuild kit was $500+, new synthetic fluid $100 and a new torque converter was $250. There's no way you'd want to put an old, possibly contaminated, torque converter back into the truck and possibly have to repeat the job. The good part is my truck shifts like new and can't be contaminated again because the bypass is now done. Best wishes.