Having been investigating a loss of power for the last few months (not solved to my satisfaction yet but I still have a few ideas to test), I can tell you that there are many many possible causes for a power loss (MAF, MAP, air in fuel, fuel filter, fuel pump, exhaust manifold, collapsed catalytic converter depending on version of the td5, broken turbo, split turbo hoses, overboost due to sticky wastegate, air filter, intercooler, injector codes, injector timings, injector seals, FPR, oil in the wiring harness, damaged ECU, leaky or stuck EGR to name but a few). It's hard to guess without looking at it. When does it happen? Does it feel like it loses power suddenly? Does it do it in all gears? When under load? Does it smoke? Do you see oil in the red plug of the ECU? Can you rev the engine in neutral?
As for the noise in the engine after you switch off, as far as I know, the only moving part that continues moving after the engine is off is the centrifugal filter. I guess possibly the turbo for a very brief moment (due to kinetic energy) too, but I'm not sure. So I'd check the centrifugal filter first, even though I'm not sure it can cause a power loss.