Sounds like a faulty fuel sending unit,but sometimes the sender card will become contaminated at the top of the sweep due to never having a full tank,don't feel bad I'm guilty of it myself! try putting some techron fuel additive in a full tank and driving it.It might sort itself out if this is the problem.
This one of those messed up things that has nothing to do with emissions but will fail the inspection cuz comes up on obd test. There should be some exceptions. Your failing test because your fuel guage not working correctly- always thought this just not right lol Agree with dmdouble- it's a problem with your fuel sending unit.