It's an odd problem. I wonder if the glow plugs are working properly? There might also be an issue with the turbocharger control (or the turbocharger itself). It might just be a failing EGR valve. It's hard to say until we get some more info about the engine, but there are a few things you can look at to start with.
Check the small hoses that connect to the turbocharger, looking for cracking or hardness. Either will allow vacuum to leak and reduce control of the turbocharger. The round gold part on the top of the turbo is called an actuator, it has an arm underneath that adjusts the vanes inside. When idling, this arm may or may not move much, but when revved a little, it should move a bit. If it doesn't (and the hoses are good), then you might have a faulty Boost Control Solenoid (BCS). These don't usually "come good" with heat, but there's always a first time eh?
A 2007 model car won't have an EGR flow detector so you can pop the gasket out of the EGR tube where it connects to the EGR valve and make a copy of the gasket but without the large central hole then install both back in the joint with some sensor-safe gasket cement. This will block the EGR and resolve the EGR valve issue if that's faulty.