Here's the physics of the subject. An osmotic gradient is a source of kinetic energy. Kinetic energy means a mass moves. Protons are mass which move across the osmotic gradient. A truism is that kinetic energy cannot be transformed into chemical energy, because force or motion of nuclei cannot be converted to force or motion of electrons which orbit nuclei.
Chemical energy is in electrons which orbit nuclei.
It always moves down hill in chemical reactions except where radiant energy is added through photosynthesis. Electrons orbit nuclei at approximately the speed of light. Their extremely low mass allows them to move at such high velocity. An electron can never see a nucleus which it is orbiting as being significantly moving. Nuclei always appear to be motionless relative to the higher velocity of electrons.