Right, cobalt is not energy free, it comes from mines in Africa using child labor.
Extracting hydrogen from water is not energy free. It takes more energy for the extraction than you can get back from burning the hydrogen.
Using solar power or wind power isn't going to make this extraction work. It takes more energy to build those facilities than you can ever generate during their useful lifespan.
Nuclear power plants might generate enough energy surplus to power the hydrogen extraction. Or hydropower. Nothing else can work.
But hydrogen is too bulky and cannot be retained in any kind of container for very long. It is not a good choice for any kind of transportation fuel. Hydrocarbons (diesel and gasoline) are a much better choice.
Hydrogen gas? No sale.