Depends on your state. Some states have "cooling off" laws, others don't. Lemon laws only apply if the dealer cannot fix a problem after a few tries.
I assume your truck is 2003 GMC or Chevrolet Duramax Allison 2500HD/3500SRW/3500DRW that just right out of the blue with very few miles on it, you started it up and and it instantly coded?
Very difficult to diagnose anything whatsoever with absolutely zero information from the truck owner or driver other than:
This Dawg Don't Hunt! What's Up???
This could be something extremely minor, something catastrophic, or something directly caused by the owner. Not a freakin' clue based on your description.
Here's valid advice based on your extensive data of the problem:
Yup. Something is not right.
Do I sound grumpy? Yes. If you want help, do not force people to pry the info out of you. We are not GM, we did not drive your truck. We can't even read your mind.