The reason a lawn mower engine stalls when hot is either due to dirty air filters or even a bad or dirty fuel cap.
If it's the fuel cap being bad or dirty and clogged up the fuel pressure in the tank and carburetor builds up due to the engine getting hot and the vapors not being able to be released from the engine properly.
Your engines gas tank fuel cap should have little vent holes that can sometimes become clogged so be sure to clean the fuel cap or replace it to keep the fuel venting properly.
A dirty air filter can also cause those fuel vapors to build up when the engine gets hot and cause your small engine or lawn mower engine to stall when hot.
Vapor Lock can happen to vehicles as well and can cause your vehicles engine to stall out but on lawn mowers the vapor lock on the engine usually is caused by a dirty fuel tank cap.
So check that cap to be sure it's venting properly.
The air intake on a lawn mower being clogged can also cause an engine to stall when it's hot so check the air intake, air filter and fuel cap for clogs.
If it's not that then it could be a problem internally with the lawn mower engine bust most times when it's happened to my lawn mower it's been either the air filter or the fuel cap but most commonly it's been a clogged fuel cap.