A couple of feet of 3/8" ID line holds ~1.5 ounces of fluid, which fits the start of your scenario. But my expectation was the foam would be at the keg end of the line and perhaps include the long dip tube volume, with the driver being outgassing from temperature cycling (which is a thing), but it sounds like there's more foam involved than I'd have thought.
Anyway...as a fridge or keezer warms up to where it eventually triggers the compressor, the beer warms up and which causes some CO2 to break out of solution. If that CO2 isn't absorbed again it'll form pockets in the beer line which can in turn cause foam during dispensing. But usually that's pretty brief - certainly not in the "wasting a lot of beer" scale.
Just on a hunch, you might think about replacing the small O-ring that is under the flange on the long (beer) dip tube. If that O-ring has a nick or surface crack it could allow pressurized CO2 in the keg head space to be injected into the beer stream under the Out post. It's possible you have a really slight case of that phenomenon that could account for the foam...
Cheers!