Electronic state is different for this two process. For measurement of optical bandgap, the electron is excited from low level to high level by the energy of laser but the electron is still in the same particle. While for eletrochemical bandgap, the electron will be extract from one particle and gave back to another particle, so more energy need to be provided.