The timing of the stop is useful evidence.
Stops within seconds: the stop solenoid may re-energise, an electronic control may lose power, air may remain after service, or the engine may have consumed the small amount of fuel available in the injection system.
Runs at idle but stops under load: suspect restricted fuel flow, blocked vent, contaminated filter, air leak, lift-pump weakness, exhaust restriction or excessive propeller load.
Runs for a repeatable number of minutes: a vacuum may be building in the tank, an electrical component may fail hot, a cooling alarm may command shutdown, or fuel supply may be marginal.
Surges before stopping: air or intermittent fuel supply is likely, but an electronic governor or sensor can also cause it.
Temporarily opening the deck fill is not a safe routine test underway because water entry and spillage are possible. Test vent flow properly at the dock. Use clear temporary diagnostic hose only where a technician judges it safe and compatible.
After any filter work, inspect seals, drain plugs and hose connections. A suction-side leak may remain dry outside. A vacuum gauge and a controlled fuel supply test can separate tank-side restriction from an engine-side fault.