The grid upgrade can cost millions for a DC fast charging station.

The inverter to make the DC power can cost 100,000.

Why not skip all this and have a diesel engine coupled to a 400V DC generator, thereby skipping the inverter and grid upgrade?

I think this would be cheaper, and lower capex and operational costs. Not to mention, most streets have natural gas lines which could power the diesel engines with a cheap and clean burning fuel. Natural Gas is very cheap around 4c/kwh. A 20% efficient generator, would yield 16c/kwh.