Hey, Kev
Check the resistance of the A/F sensor:
https://demos.starbase7.net/t3Portal..._rm_index.html
Engine/Hybrid System -> FA20 Engine Control -> Air Fuel Ratio Sensor -> Inspection
I've recently fixed my friend's car with similiar problems. On top of the P0171 code, there were also the P117B and P0172 faults.
Replacing the A/F sensor with a new Denso unit and a "stock" the drop-in filter (DO NOT install the MANN C2620 OE replacement filter) fixed the problem.
The car is driven with an appropriate tune (catless exhaust manifold)? Presence of exhaust leaks has been checked (Manifold - Engine Block and Manifold - Overpipe + both sensors, A/F and heated oxygen)?