The/a phase connection may have got to hot with the heat esp if the bike was being ridden up any steep gradients or even in to high a gear near to stalling speed.
The bikes system/ controller will need testing but you can carry out a simple free test, disconnect the hub motor cable connector...