P0172 and P0175 (system too rich on both banks)....
...The engine runs a bit rough when idle and sometimes turns off.
What does the freeze data show for TPS and MAP when the DTC's set?
If the TPS was at 0.47 - 0.50 volts (meaning closed throttle) and MAP was greater than 1 volt (meaning higher than normal intake pressure), the odds are very good that the EGR valve was sticking open.
The EGR VLS parameter should be less than 1.2 volts at idle (ideally you'd see it at 1.13 - 1.15 volts.
An EGR valve that is sticking open can cause stalling at idle, and fuel system rich DTCs for both banks.
Take a look at the EGR VLS at idle with the engine warmed up, and also look at your MAP value - if both values are high, tap (lightly) on the side of the EGR valve with a screw-driver handle or small (2 oz) ball peen hammer. If both values drop when you do this (the idle will smooth out too), the valve pintle was sticking open, and you would be advised to replace the EGR valve.
BTW, you can ignore the VTM DTC (which was probably a 77-1 Powertrain System Failure) if the MIL was illuminated - the VTM code would have set simply because the PCM had set an MIL-request fault.