Is this a 4 stroke? Are ya running your engine with no oil?
Kinda sounds like with heat expansion the engine stops working. So when ya let it cool off for 5 mins it starts up again but when it gets hot it stops and ya cant even turn the engine over cause it's locked up. Until it cools off then it seems normal, until it heats up again
Cause - piston ring end gap too tight - under .012" - Heat expansion closes ring end gap -Too tight in Cyl
Cause - piston to cylinder wall clearance under .003" - Heat expands piston - piston contacts cylinder wall
Cause - valve guide to valve stem clearance too tight - normal clearance is .0015" to .002"- Heat expansion stops valve from moving
I bet your piston ring end gap is too tight It should be min 012" max .018"
If ya need to know how check your ring end gap or how to file the rings end gap
I can help ya