Judging from the variety of the sensors dodge used in these trucks the ECM uses whats called a "speed density" equation to determine fuel injection pulse widths for each intake stroke on each cylinder.
basically an array of sensors such as your MAP sensor, IAT sensor, and to an extent the TPS all determine the quality of the atmosphere inside the intake manifold, which implies how many molecules of oxygen exist in each cubic foot of air that passes through the manifold, affected by temperature, vacuum, throttle position, etc. which basically implies the "load" of the engine.
then the ecm compares this to a pre-programmed table that compares the rpm of the engine (and how much volume it should be displacing for a 5.2 or 5.9 engine at that rpm) and cross references the load (the amount of oxygen per volume in the manifold) to determine how much oxygen the engine is actually ingesting and at what rate.
as mentioned before by HeyYou, since your engine is of a bigger displacement then the computer thinks, the engine will run incredibly lean.. I'm surprised its even functional considering the differences in a 5.2 and an approximately 6.6 litre engine.
Since gasoline needs to be mixed with intake air in as fine of a mist as possible, and since barometric pressure has a great effect on how well gasoline remains suspended or re-condenses, the TPS is used by the ECM to either enrich or lean the mixture based on your throttle changes.
when you let off of the throttle, the still-decelerating engine pulls a considerable amount of vacuum across the intake manifold behind the closed butterflies, which makes gasoline very succeptible to evaporating and becoming more finely mixed with the intake air. as such, I can see most car manufacturers programming the computer to slightly lean the mixture during closing-throttle transitions in order to save fuel and help emissions. combined with the fact that your base fuel-injection map is already very lean for the displacement you are ACTUALLY running, this could be leaning the engine out enough to stall it.
You said the throttle response is strong when you OPEN the throttle (and the TPS tells the computer to enrich the mixture due to the DROP in vacuum), so I bet you could (VERY CAREFULLY) experiment with disconnecting the TPS and having opposite results: weak throttle response, but solid during throttle closing.
Regardless, considering having a custom tune burned into an ECM can be both costly and complex, some short cuts modern-day-efi-hot-rodders sometimes take involves tricking the ECM.
For instance, you can consider simply buying a set of fuel injectors with a higher rate of flow, or upping the fuel-injection line pressure for example in proportion to the amount of displacement you have gained going from a 318 to a 408. However, these shortcuts are highly dependant on the new engine having a similar torque curve (which is an essence a VE curve) for them to be effective solutions.
Personally when I got done building my 408 I'm just slapping a carb on the bastard.