I recently suffered similar problems. My bike stands for long periods between use.
Traced to incorrect mixture due to partial pilot jet blockage. Would start OK when cold, due to flooding carb. Drove OK and ticked over when hot but embarassing to restart.
After a good carburettor cleanout seems OK.