Well, I own a different truck, but bad DEF can be an issue. The issue is that DEF has a very specific gravity and another property that can be measured in the DEF tanks. DEF is composed of distilled water and roughly 27 to 33% aqueous ammonia. If this isn't met, it can throw off the DEF sensors causing an issue. I bought some DEF in a jug and keep re-filling them at a truck stop since it's so much cheaper there and I figure that they will have fresh DEF.
Just another thought that DEF could also have degraded. Depending on your environment, DEF has a shelf life anywhere from 6 months (if it's really hot where you live) to 2 years (if you top out at around 70 degrees on average where you live and don't have any prolonged weather spikes above 90 degrees).