I'm not really seeing that as far as resale value. I tend to ignore "advertised" prices because everybody selling a decent used vehical believes whatever they have is gold. And dealers will often advertise high so they can then tell you you are getting a "discount" when they sell it to you for the real value. Just for grins, I went to kbb.com and got values for two hypothetical trucks. I used KBB because that represents an average actual selling price in my area. Both were 2018 2500 Laramie's with 60,000 miles and with no options selected other than color and engine choice. So otherwise identical other than gas vs diesel. On a private party sale, the top end of the range was 9,852 higher on the diesel than on the 6.4 gas. On trade in, the diesel was 6,024. So on the private party sale, thats right about what the difference is on a new truck and you actually lose a bit on a trade in. Now, if you assume top dollar for the diesel and lowest end for the gas (not likely) they are 14K apart on private party sale 12K apart on trade in...but you have to make a pretty huge assumption (top end for one and low end for the other) to get those numbers. Then, don't forget when you bought the truck new, you probably financed in the $9650(??) for the diesel engine so you would have some extra interest there.
Another factor is that for trucks purchased new today, no one really knows how fuel prices, Govt regulations, market conditions etc will influence used prices five years from now. In 2021 for example, I traded in to a GMC dealer a 2019 GMC Canyon that I had bought used from that same dealer. They actually bought it back from me for more than I paid them for it to begin with...but doing a similar trade today, that just wouldn't happen.. You just never know and things like that are not predictable. Personally, I just bought the truck that seems to meet my needs and desires the best, and resale is what it is. Also, I probably would not buy a used diesel unless there were maintenance records telling me exactly what had or hadn't been done to it.