I don't know what the term "flat" battery means. When you crank it when hot is it cranking slower than when it is cold? If it cranks at the same speed it would lead me to believe you may have a valve issue depending on the age. I had a machine that would start great in cold, would not start hot, when it got hot and things expanded there was took much play in the valves so it was getting leak down and not getting full compression when it was hot. If it is a cranking issue like slow crank possible the starter is getting hot and expanding creating a dead spot in winding or armature, bad coil can do the same when hot, expand and if there is a break in the winding produce weak or no spark. Just ideas, there are lots of things that can contribute unfortunately. Hot start issues are weird