Talk to a marine engineer about the overhead (equipment, training, emergency procedures, etc.) of adding a small-scale solar plant to all the things that they've already got to deal with on a ship.
And recall that this bridge - https://en.wikipedia.org/wiki/Francis_Scott_Key_Bridge_(Balt... - will need a multi-billion dollar replacement, because the tiny engineering staff of a huge freighter could not diagnose and correct a surprise electrical failure. Within the maybe 3 1/2 minutes between the initial fault, and when the collision became physically inevitable.