Leaving aside all that, I'm curious if a hydrogen-oxygen reaction would actually work as a propellant for shots? Does it have enough impulse? Too much?
Yes, it would work fine. The problem would be with storing the hydrogen. In the first place it takes up a lot of room per unit of energy stored. In the second it diffuses like crazy through seals and valves.
If you want a weapon that stores solar energy, I suggest that high-tech rechargeable batteries will store more in the form factor of a rifle, and will hold a charge better than a pressurised chamber will hold hydrogen. Either a coil gun or a rail gun is solid-state with no moving parts and ought to be very durable. A rail gun might be a little bit fussy about ammo: depending on how the tech to prevent rail erosion works out it might fire anything conducting or it might need superconducting sabots, but either way it might need projectiles moulded or machined to close tolerances. A coil gun is not as simple, and will probably be more expensive, but it ought to fire anything that is ferromagnetic (iron scrap) and will fit down the bore.
Anyhow, suppose that the stock and forearm of a rifle give you 0.03 square metres of solar collector, 50% efficient. In full Earthlike sunshine it will recharge at about 30 W, which is to say collect enough energy to produce the muzzle energy of a 5.56mm NATO round in about an hour, assuming very high efficiency in the weapon part. In a spaceship, in the trunk of an air/raft, in a cave, in a forest or swamp, indoors, in cloudy weather, or on the world of an M-type, K-type, or late G-type star it will recharge significantly slower.
For a practical survival gun I recommend a powerful air rifle made of high-tech materials.