Diesel engines can these days have for example these kinds of problems:
- The turbocharger can break. Gas engines due to the high RPM they are capable of running at don't need turbos, but a turbocharger is practically mandatory in a diesel engine to obtain any useful amount of power.
- Direct injectors can fail. Replacing them is extremely expensive. I once read an article about the repair business of these injectors. Many countries have special facilities with cleanrooms to repair these injectors, because repairing, although expensive, is less expensive than replacing.
- The particulate filter can fail. It is a very expensive component to replace.
- The exhaust gas recirculation system that is mandatory to combat NOx can clog the intake valves. In (non-direct-injected) gasoline engines, the injection of gasoline into the valves will naturally keep the valves clean, whereas in a diesel engine there is no such mechanism.
So, it's not the regular maintenance that will cost more, it's the extremely expensive parts that can fail. Note that some gasoline engines have turbos, and gasoline direct injection engines have direct injectors and also may have a particulate filter. The intake valve clogging problem also applies to gasoline direct injection engines except some engines that have both indirect and direct injection systems in parallel (e.g. some DI engines by Toyota).
When taking into account the NOx emission issues as well that have led many large cities to imposing diesel bans, I would say gasoline is the clear winner for the long run.
Consider also this: if you fill a modern gasoline car with diesel, no long-lasting damage is done. Just empty the tank and fill again with gas and you're good to go. However, if you accidentally fill a modern diesel car with gasoline and actually start up the car, the repairs will cost thousands.