Electricity -> Water Electrolysis -> Hydrogen -> Running a Combustion Engine has horrid, atrocious efficiency. Like comically bad. Just light your wallet on fire and save the extra steps. There's a whole host of other issues like hydrogen embrittlement of heads and cylinder walls, crazy pre-ignition and detonation issues, completely loss of piston dome cooling (fuel spray is actually used in gasoline engines to cool the piston surface), high pressure storage and filling, no lubrication for injectors, pretty substantial power reduction (gaseous fuel displaces much more air than liquid fuel, greatly reducing power output), crazy hot cylinder temperatures that jack up NOx through the roof, and probably a ton of other problems I don't know about. There might be a case to add a little bit of hydrogen to a conventionally fueled engine though. I've read that it can provide a light catalyzing effect, which is interesting.

You can almost make the case if you produce hydrogen then run a fuel cell, but it's still not great, basically marginally better than gasoline. Plus we have to build a whole new infrastructure to supply, distribute and deliver hydrogen to the end user. Some car manufacturers are going that way (Toyota) by producing electric cars with PEM fuel cells. Ideally you just take the electricity and put it in a lithium based battery and skip all these inefficient chemical conversions.