We had the exact same issue in our 2021 GMC Sierra Duramax with 20k miles, pulling our 4600 lb trailer from NC to ND. We kept getting DEF warnings when the tank was nearly full. Put in only a gallon (all it would hold) and sensor would reset for short while then warning would come on again. Next day, seemed ok, no warnings. Next day, got check engine light as soon as we started out. Using Onstar, diagnosed emissions problem P249C. Turned out was DEF injector failure. We had to find dealer that had the part and wait 5 days to get part installed because of holiday weekend. No problem since install it we aren’t home yet. Part replacement was covered by warranty.