Welcome to TRS
Yes, many have found 3rd party IAC Valves do not work well on their Rangers
Simple test for a vacuum leak is to warm up engine fully, and let it idle
Unplug the 2 wire connector on IAC Valve
It will close and RPMs should drop to 500 or so, engine may even stall either is GOOD, it means no vacuum leaks
If RPMs do not drop then there is a leak
(there is an anti-diesel screw on the throttle linkage, often confused with an idle screw, because it does control throttle plate's closed position, this should not be adjusted unless engine is fully warmed up and IAC Valve unplugged.
At that time you can adjust it to set minimum voltage for TPS, under 1 volt, then you would start the warm engine and let it idle, if idle is below 600 then all is well, if higher then unscrew it until engine is barely running, its set)
Codes P0171 and P0174 means the computer's on the fly calculations are off by more than 20%, the computer is having to opening the fuel injectors more than 20% longer than it calculated according to O2 sensor feedback
And on both banks of a V engine, so not a lower intake leak or exhaust manifold leak, or an upstream O2 sensor issue
It needs to be something common to both banks of the engine
The Computer "knows", in this case, its running a 3 LITER engine, so it "knows" exactly how much air will be pulled in at any RPM, its just math and that's what these computer are made to do, fast math for on the fly air/fuel mix calculations
It also knows the size of the fuel injectors, and the fuel pressure specified, but has no way to confirm pressure.
What the computer doesn't know are the variables in all vehicle engines
Engine temp, ECT sensor
Air Temp, IAT sensor
Air weight, MAF sensor
Throttle position, engine load, TPS sensor
Actual Fuel pressure, NO sensor
O2 sensors see Air/oxygen in the exhaust, too much is Lean too little Rich, this is feedback
And the computer itself, while uncommon these do fail
Since you have already replaced alot of parts, I would spend another $25 on a Bluetooth OBD2 reader so you can watch Live Data and see what all the sensor are reporting to the computer, this is what the fuel mix is based on after warm up
The computer calculates Short Term fuel trims(STFT) on the fly, based on RPMs and above sensors
STFT 0 is computer's calculation
After it is burned O2 sensor gives computer lean/rich voltage
If lean computer opens injectors on that bank 2% longer, STFT 2, then STFT 4, and STFT 6, ect..... until O2 sensor shows good voltage
If rich then STFT -2, then -4, ect......less open time for injectors
These are percentages of calculated open time
The computer has a Long term fuel trim(LTFT) for each bank, this allows the system to "age gracefully", smaller air leaks, changes in compression, valve guide seal leaks(burning oil) and fuel pressure changes, will cause LTFT to change over time
LTFT is the average of STFT over time, so if engine was running best at STFT 5 then LTFT would be set as +5
LTFT is saved each time computer is shut off and then reload on restart, it can't be cleared with a reader or by unhooking battery, wouldn't be much good if it could be, I think a Ford Reader can clear it but not sure
LTFT is used on cold start when sensors are not warned up, computer has preset air/fuel mix tables it used and offsets those with LTFT
After warm up computer calculates STFT the adds/subtracts LTFT to that for STFT 0
So if LTFT was 5 then STFT 0 is actually +5
If average STFT during this drive time was -1 then LTFT would change to +4, if average was +1 then LTFT changes to +6
LTFT is so Computer doesn't have to start from scratch every time you drive the vehicle
There is more to LTFT, rear O2 is also used for this
But if LTFT gets to +20 because of long term air leak or ??? then you will get Lean codes
And even after you fix the problem, fix the leak, it will take awhile for LTFT to start getting lower, weeks driving every day
The Live data would show you STFT and LTFT, +15 to +20 is when Lean codes start showing up
If you fix a "lean" problem then STFT will go -2, -4, ect.......which, over time, will bring down the +20 LTFT
A partially block exhaust system can also set lean codes, but run vehicle at highway speeds, you will notice a lack of power as exhaust back pressure builds up
You can also use a vacuum gauge to detect this and many engine running issues, still a great tool to use/have