I've had all sorts of inaccurate temp sensor issues on my Suburban. It's got the 7.4L so not the same engine as yours, but most of the stuff everyone already suggested are the same things I checked & replaced on mine. Originally I thought the gauge was reading too low, but it turned out it was fairly accurate and a radiator flush (got all sorts of brown gunk out) had actually helped the engine run cooler. One way to check engine temperature is with a laser infrared thermometer (I bought
this one from Amazon) and point it at the thermostat housing when the engine is hot and running. See if that matches the dash gauge.
Are you losing any coolant, even small amounts that you can smell when the engine is hot or right after you shut it off? Recently my gauge was all over the place like you described, I could smell coolant, and it turned out that the water pump was bad & leaking. The loss of pressure in the cooling system was keeping the coolant from circulating and making the gauge go all wacky. So check that out too.