Get a pair of inline red spark testers and fit them to the mower.
Then when the mower stops have a look at the spark testers.
If they are both flashing then you have a fuel supply problem
If they are not flashing then you have an electrical problem.
The most common type problem with this symptom is floating debris in the fuel tank forming a plug in the tank outlet .
But the best thing to do is work out which part of the mower is giving you problems as coils can also overheat & stop working till they cool because of a build up under the blower housing is restricting cooling air.
And the same problem can cause a siezure.