There is a flame-present sensor (probe) that detects heat and sends a signal to the gas valve, indicating the pilot light is lit. If that probe has a slight haze or buildup on it, or if it is not in the flame path, it might not be producing enough of an electrical signal (only a couple millivolts) and the gas valve shuts it off. If you can reach it with a small, long-handled brass brush, try cleaning it off and see if that helps. This happened to me once on my popup, years ago (2000).
2015 Jay Flight 32RLDS Elite
2012 Chevy 2500HD Crew Cab LTZ (6.6L Duramax/Allison)
Equalizer Hitch (1200# bars)