There several possible reasons for this to happen on that model engine.
Your engine could be going into safe mode due to an issue that the ECU is monitoring and/or the ECU itself has an issue. Also, besides a potential ECU/sensor issue, there are three external modules to the ECU which could be causing this to happen, also. [Detonation module, Oil Injection module, and Idle speed controller] To clarify, not all modules interact with the ECU, though.
Except for very early models of this ECU, the best way to isolate the actual fault is with a DDT [plug-in diagnostic tool]. Except for an early model ECU, it stores the fault for reference by the mechanic.
You didn't mention any "trouble codes" found so, I suspect that your mechanic may not have one and is guessing or... you have an early model ECU without a diagnostic connector.
However, this engine also uses two separate ignition modules [switch box assemblies] to fire the coils for spark plugs. It may be possible that one module is dropping out when it gets hot. A somewhat common issue with this design.
I suspect that the mechanic has never actually duplicated the problem at shop level. This needs to happen to isolate the fault if no trouble code was set in the ECU. You could keep replacing parts until the problem goes away but, that is an expensive guessing game.
There is a non-DDT test sequence from Mercury. But it is primarily meant for the early ECU model engines. Otherwise... find another mechanic with a DDT to go through the system checks for you. The switch box testing sequence is a different set of operations. Both procedures are quite lengthly and covered in the service manual.
Let me know if you would like more info.