What would prevent a solar powered aircraft staying aloft forever?
The most common failures in planes start with: a human mistake or a mechanical failure. Where, of course, mechanical failures are much more likely to happen on moving parts.

Satellites have very little moving parts: you get couple servo motors to adjust the angle of your equipment such as the solar panels and the antennas. Both happen in units of full rotations a day. You also often have some small rocket engines to correct the satellites course, but they are rocket engines whose moving parts comprise more or less just one valve.

In a plane, however, you have pieces that move very fast and fluids of all kinds (not only fuel which you need not have on a solar-powered plane, but also lubricants, hydraulics etc.), also very sensitive mechanical sensors whose non-stop operation is crucial for the flight. This all needs to be inspected, oil levels checked, hydraulics checked. Last but not least, the weather in the space is quite calm, compared to the atmosphere. Depending on how high you fly, you meet clouds, storms, birds, temperature changes etc., which all can add to the wear of things and make things require maintenance.

I'm not sure which would be the limiting factor, but I think that either some equipment wouldn't be operational without maintenance, or you would get a mechanical failure of some kind.