I wouldn't worry about either, but if the motor were to fail on your ebike a few years from now, the issue is not ease of replacement but whether parts are still available.
Mid motors tend to be brand specific and all the electronics are inside the housing, Makes for a modular and easily replaceable unit if a spare is available.
Hub motors are very simple. Most only carry 3 or 4 internal sensors, and the control electronics are usually external. A few proprietary systems may still exist, but the industry model is a generic wiring interface. While they would be indeed a PITA to replace, with the spoking, the whole wheel/motor assembly is inexpensive. So if your hub motor bike were to go bad, you can replace it with almost any other wheel. Ask A. Hicks, who put different motor on his 6 week old ebike because he needed more performance. And with hub motors, since the electronics are external, one can change those using anything that fits, although the labor to adapt connectors woud be expensive. That doesn't bother a hobbyist like me.
Connections and water ingress are the weak point for ebikes. Both of these have stopped me.