I had a Toyota avensis that had the same problem.
The Toyota repair ,told me to replace the starter switch,and if this did not work then they would just replace everything,until the found the problem.
A very expensive way to repair a car.
But I found that there is a switch that is fitted onto the flywheel,that sends a signal to the engine management system and starter motor.
Will eventually cut out while driving,will not start without a push start to tow.
It took three garages and hundreds of pounds.
Then I found a garage that repaired Toyota as well as all or most other cars.
It took around two hours to replace this switch,at that time it cost my just over one hundred pounds including labour.
As a garage about the possibility of a faulty switch on you're flywheel.
They don't normally know about this switch,so if you tell the garage you take it to,they will research this switch for you.
Normal faults created by a faulty flywheel swith,will give most machanics the impression it is a faulty ignition switch or the management system.
But if you're car cuts out,is a problem in starting up and mainly cuts out when revs go low,eg a roundabout or having to slow at a junk tin.
If this is happening with a Toyota,I would bet it's the flywheel switch.