P0171 is System too lean, bank 1. P0420 is Catalyst system efficiency below threshold.i beleve that P0171 code is Catalyst system efficency below threshold. Meaning your emissions is below standard. If you have already cleaned the MAF sensor and replaced all those other parts mentioned, your cat is at fault and replacement would be the only fix. I had this problem with my 99 2.7L tacoma. i did all the things you did, and still getting p0171 after 2-3 miles. replaced the cat and code never came back.
then about a month later my truck was bought back because of Frame Peferations! what a waste of a grand!!