Yes it happen with both packs, and the surface of the road seems to make no difference,i.e. it will happen on a smooth road or bumpy
Sounds like a controller board failure, intermittent fault. Mid-drive motors get very hot as everything is in one unit and because its down by the bottom bracket they have to be sealed against water ingress so are hard to cool. Often they are the worst motors for over-heating and being thermally throttled. The hot/cold cycles of such motors can put the control electronics under a lot of stress and there is of course the possibility of water ingress too. So if its not going to be the battery packs it feels like the main control board in the motor is likely a bit flaky perhaps one component is failing or there is a dry joint somewhere. Sometimes torque sensors fail and give garbage data to the control board but I can't see why the display would cut out with that. 9000 miles is brilliant service for a mid-drive motor I feel considering their complexity so I don't think you have done badly its just about trying to push it a bit further in lifespan. I would definitely be cautious about spending huge amounts on repair for such an ebike and getting sucked into paying constant bills as the ebike ages.
I guess my approach might be to look for a working ebike with the same motor system and end up swopping parts until I knew what was faulty and could then solve the issues by finding that exact part secondhand. I remember talking to
Halfords staff about ebike faults and that is exactly what they end up doing a lot of the time when their ebikes have annoying faults that are hard to trace, typically the Suntour HESC motor system ebikes that they sell so many of. If you already have two good Shimano battery packs then a ebike with an end of life battery pack would not be such a big deal for you. This assumes Shimano repairs are similar to Bosch or Brose where often repairs get close to the £1000 and often the motor unit has to be sent off sometimes to Germany for repair and service. So you have to pay for disassembly at the bike shop, getting sent to Germany, repair, getting sent back to the UK, refitted by the bike shop etc and you end up with a huge bill. The way I understand it is most bike shops can only do basic servicing of proprietary mid-drive motors, belts, nylon cogs, bearings etc. However I haven't heard much about Shimano issues as they are likely typically more reliable and may not have as many units out there anyway. So don't know what Shimano ebike dealers can and can't do and how much they charge for repairs. Maybe their repairs are more reasonable.