The hydrogen fuel process is thermodynamically very inefficient. You lose energy with hydrolysis - the "green" way to extract hydrogen. You lose more energy compressing/cooling the hydrogen. You lose more converting it to electricity in the fuel cell.
So, if you have energy that will be lost anyway, you can use it for this process - say, solar photoelectric energy that the grid doesn't need. Otherwise, you raise the cost significantly due to all the energy wastage. But... the process overall is low carbon.