I disagree with this logic, as one could apply it to any theoretical biologic feature. The fact that random-walking evolutionary processes haven't stumbled upon a more optimal solution has nothing to do with whether such a solution exists or is easy to find.
And the organism's genetic line can persist with that mutant gene indefinitely, building onto it until it becomes a useful feature.
(This isn't so true in especially small organisms, where an extra gene here and there might blow their size or resource budget. This is one of several things constraining the evolution of mitochondria, for example.)
Where's all this energy coming from?
Sorry perhaps this is not what you meant to write. For anyone who wants an unmangled understanding of photosynthesis please consult Wikipedia or other text of your choice.
However my original poorly explained thought stands there needs to be an extra component that will be consumed like ATP or H2O...