I have heard several times the wisdom that you should not switch gears while pedalling hard ("under load").
It is true that an optimal gear shift works by easing the load, shifting while rotating the pedals with practically zero load, and resuming the load after the shift has happened. With practice, it is possible to time the shifting in such a manner that the shift happens when pedals are at 6-12 o'clock positions when there would be naturally no load anyway. After the shift has been detected from its sound, or if traffic noise is heavy, from the change in gear ratio as felt by the legs, the load can be resumed. Done properly, there is very little interruption in load.
However, this does not work for mid-drive electric bicycles. An electric bicycle has a certain amount of torque, let's say 50 Nm. In an effort to increase the average power of the e-bike, the mid-drive manufacturers make this torque continuous as opposed to oscillating in unison with pedaling loads. So, when you are naturally in a position where there is no pedaling load, the mid-drive still is outputting its torque. The mid-drive software cannot know you want to execute a shift at this very instant. Then, after the mid-drive software detects the shift from the jerk of the chain, it reduces torque to zero but too late. The shift has already happened. However, even with mid-drive e-bikes, the cyclist can and should reduce the pedaling torque during shifting -- then only the motor torque (usually when heavily pedaling, lower than pedaling torque) is present.
In the past, bicycles had chains very unlike those in bicycles today. The chains had full bushings like any reasonable chain in other use such as motorcycle or industrial equipment. The ends of the pins were not "punched" so you could take apart the chain at any position and re-join it using the existing pin (being careful you won't push the pin fully out when disconnecting the chain). Such chains could last tens of thousands of miles if properly taken care of (never lubricating an already oily and thus dirty chain, but rather cleaning it before lubrication).
Then the bushingless chain was invented. It replaced the full bushing by two bushing-halves integral to the inner side plates. The bushingless chain is stronger, lighter, cheaper (4 distinct part types as opposed to 5) and more laterally flexible. However, the bushing-halves do a really poor job at keeping dirt out so bushingless chains rarely last more than perhaps two thousand miles.
Furthermore, the chain was considered not strong enough for shifting under load so modern chains have "punched" pins. You cannot re-join such a chain with the existing pin. Instead, you must push the existing pin out and use a new reinforced connecting pin that is larger so it stays in the hole that was damaged by pushing the "punched" pin out. (At the location where the reinforced pin is used, the chain may never be broken again, so a 116-link chain can be only re-joined 116 times.)
The combination of lateral flexibility and strength of the bushingless chain and "punched" pins improving pin retention means modern chains actually don't suffer from shifting under load.
A cyclist can (and perhaps even should) still use the good practice of easing the load while shifting a modern chain, but that's not realistic on mid-drive e-bikes because the mid-drive motor load is not eased quickly enough.
Otherwise Unspeakably Bad Things are supposed to happen.
The bad thing is a broken chain. If the chain didn't break, no bad things happened. Chain wear life is unaffected by shifting under load. So you won't get 1000 kilometers of life shifting under load often and 5000 kilometers of life never shifting under load. The wear life in both cases will be the same.
Modern chains shouldn't break even when shifting under load, and mid-drive e-bikes cannot reasonably be shifted without load.
Such is the parts market today that you cannot find a bushing-type chain anymore unless it's a ridiculously expensive new-old-stock item.