5.9 all day every day.
Unless the 6.7 has had the “issues” removed, as well as complete documentation of what new parts and tuner/software is in place. The sticky wicket with buying a truck missing those bits is if you don’t know what was done, it’s hard for a tech to fix. Because it’s not original.
The same logic applies to a 5.9, albeit a lesser extent because it’s a simple engine with few emissions components to begin with.
I personally avoid buying modified vehicles, not just engines but suspension etc. For one thing I prefer my own flavor of mods. And the modified vehicle is more likely to be a challenge getting maintenance and repairs done because of non-standard parts.