(it's pretty dumb to let it happen - I've nearly done it twice) but I can see how i happens.
I just can't see how it can happen.
Forget about fuel gauges.
Flying an aircraft is just too important to rely on such things.
Know how much you have and how much you burn and have plenty to spare.
If in doubt DIVERT and fill up.
Ken