What it usually turns out to be
SI B11 02 08 treats 2A82 and 2A87 as one problem: a camshaft that is late to its target because the VANOS pistons are not getting enough oil pressure. The complaint is the same — a warm-engine power loss with the Service Engine Soon lamp, gone after an ignition cycle — and so is the procedure: test plans, oil-filter cap insert, both solenoids, fresh oil.
On the N54 the bulletin adds a consequential fault, 3100 "Boost-pressure control, deactivation – boost-pressure buildup prohibited", so a twin-turbo car can show a boost code beside the VANOS code while the root cause is the VANOS oil supply.
What gets replaced first, and why that is wrong
As with the intake code, the VANOS mechanism gets quoted while BMW's own procedure starts with the filter-cap insert, both solenoids and fresh oil — and on the N54 the turbos get blamed for a 3100 that the VANOS fault caused.
From a documented source: BMW SI B11 02 08 (VANOS faults).
Seeing 2A87 on your car?
I come to the car, read the modules and trace the fault to the actual wire, connector or module.
Run a repair or body shop? BMW programming support for shops