Typical Lean codes.
Most likely an intake air leak or MAF related. Intake air leak can easily be ruled out by Smoke Testing.
You can do this with about $15 in parts.
Cheap fluid transfer pump from the local Auto Parts store. A few rubber gloves and rubber bands and a few cheap cigars.
https://www.youtube.com/watch?v=AsgB9eBl58I
Best to rule out the simple and obvious problems before dropping bigger money on parts.
Still would best to also see a 4 minute warm idle Log again.
The problem here is if there is an intake air leak, it will cause the MAF to under report because air will be bypassing the MAF.
It might be something as simple as an intake boot that was not installed properly and has pulled off. Not sure if the intake boot is like the M54 engines where the small tube cracks.
I think this may be like what your engine has?
Genuine BMW | Intake Boot/Air Duct (E70 X5, E71 X6) - BimmSport
The smaller tube typically connects to the ICV, assume this may be the same for your engine?