That motor isn't terribly sophisticated so I think that something doesn't like getting hot. One common source is vapor lock but I don't think based on your exact symptoms that is the problem. So that leaves spark. Unfortunately there are causes that can be quite hard to track down since they are intermittent.
Areas of concern are ECU which I don't think is the problem (only because they don't fail like yours does unless water cooled and there is a cooling issue)\
A bad connection that acts up when hot,
More ;likely a bad stator or pulser. Both of these are tricky to test but doable but are if intermittent, may test OK but act up when hot.
All three components are expensive so I wouldn't run out and buy parts yet.
I might try the following. Try to cool off some components after the failure to see if you can narrow down the possibilities. I am not a fan of spraying cool water on a hot engine but it occurred to me that if you have a cordless leaf blower, after a failure you could remove the cowling and maybe the flywheel cover and blow air under the flywheel for a few minutes and see if the motor fires up quicker.
I haven't tried this method but who knows
Likewise if that doesn't help you can use the blower to cool off the ECU and see if that helps shorten the time it takes for the motor to refire.