I have a Haibike with a Yamaha system, twice it cut out going up a long hill. When I took it fior it's after sales check over they said it was the battery disconnecting which caused it .
I noticed the battery which sits in the frame did not push fully up to the connector at the top so I loosened the screws holding the locking mechanism at the bottom of the battery, then pushed the battery fully up onto the connector using a plastic lever, then I adjusted the locking mechanism up slightly so it now sits fully engaged on the top connector.
Had to play around adjusting it until i could get the battery in and out without too much hassle but it seems OK now.
Don't know if this helps others but worth a look.