The running out of fuel, when there is still fuel in the tank, is suggesting to me; that there is a crack or break in the pickup pipe, between the top of the fuel tank, & the bottom pick up point. Once the fuel gets down a bit, the break in the pipe, partway down, gets exposed, & sucks in air.
I'm afraid, it's time for the tank to come out, for a complete inspection & clean. You cannot do any thing inside the tank, or even remove the pick up assembly; unless the tank is removed. While it is out, make sure you check the fuel sender unit.
Cheers Banjo