2004 330i with 170,000 miles had misfire codes which were caused by the catalytic converter. Recently bought the car with a known SES light for lean codes. Fixed those, then had the below adventure.
Problem solved thanks to other threads on here. These two in particular:
The key is that the misfire was always under acceleration/load and stayed on bank 2. Most of the time cylinder 6 P0306 code, but I would get P0304 and P0305 and P0300, on occasion.
Symptoms: misfire codes that set the 'service engine soon' light only during harder acceleration and at high RPM (usually around 5500 for me). It would then go in to a low power limp mode for a while. If I lightly accelerated to red line, I would not get any codes. It also felt like it did not have 100% power. Again, mostly cylinder 6, but always bank 2. It was usually in second gear, but I rarely tested it in 1st or 3rd as I did not want to damage the motor in 1st and top of 3rd can result in a ticket. I did test it in 3rd once and still got the misfire.
1. Swap coils between cylinders, stayed on cylinder 6.
2. Change spark plugs. The old ones were obviously old and the gap was very wide. Still had the misfire.
3. Swapped in a known good MAF (fortunate to have 2 330i's), still misfire.
4. Sprayed brake cleaner looking for vacuum leaks, no signs of leaks.
5. Checked compression. Looked good but cyl 4 was a little low at 165.
6. Installed new coils because I wanted new coils anyway. Still misfire.
7. Checked battery and alternator. They were good.
8. Changed fuel filter (due anyway). Still misfire.
9. Smoke tested. No leaks noticed.
10. Changed the oil filter housing gasket (just something else that needed to be fixed and I wasn't making a ton of progress on the misfire code!)
11. Checked vacuum caps on back of intake manifold. They were fine.
12. Checked fuel pressure at the rail. It was 3.5 bar (good).
13. Checked fuel trim. Odd result of + on bank 1 while - on bank 2
14. Checked alternator voltage again at the battery. Still good.
15. Removed pre-cat O2 sensor on bank 2 and test drove. Four pulls and no misfire!
Ultimately, I removed the catalytic converters (tough job) and installed E36 OBDII manifolds and the Spec E46 racing exhaust by MagnaFlow (plan was for this car to be the track car). Test drove again and no codes. No codes since.
One test I wish I would have ran was with the O2 sensor installed in the manifold but unplugged. I am curious if the issue was purely mechanical back pressure, or the back pressure sending a rich reading through the O2 sensor that messed up the fuel trim, which then caused the misfire.