You didn't mention the year of the gen, or I just missed it. It may be the fuel filter to the gen is plugged after running for a while, and after it sets the material allows fuel to reach the gen. Not getting enough fuel will cause the 12 code to appear, as the engine will not respond to the need for more power. Or, the fuel pump is getting weak, or you have a leak in the rubber hose that is used in the fuel supply from the tank to the gen. You could try rigging a temp fuel supply from a gas can, with new hose to the supply side of the fuel pump to see if their is any difference.