My 07 F250 had the same problem. Sometimes it would display that the tank had plenty of gas in it, when in fact it was almost empty, and other times it would read empty when I had gas.
For what it's worth, I was advised to purchase some Diesel Kleen Octane Boost and, maybe it was coincidental, but the problem cleared up.
Could the Sending Unit have been gunked up and did the DK clean it up? Not sure, but it saved me from having to install a new sending unit, at least for now ;-)