BMW got much better since the switch to B series engines, N series era was horrible. Timing chains between the engine and gearbox are a pain point though, they need to be replaced with mileage.
The N52 seems rather better, as all its common faults are relatively cheap to fix.
The older N52 engine is also very solid and reliable, my high mileage 2006 330i (E90) has been rock solid reliable in its powertrain.
My mechanic told me the N20 engine is terrible though, he has encountered an absurd number of them failing. The N54 is solid enough mechanically, though they get HPFP issues and need occasional cleaning of soot/gunk from valves.
It's worse in B47, which carries over the same timing parts as N47 and it's generally acknowledged it's best to replace the chain at 120000km there.
6cyls seem to fare better, my guess is the pulling forces on the chain are spaced more evenly.