So who authorised the second flight? the student has deviated from his planned route and should now be reauthorised by a FI at the school!
Was he briefed in accordance with the AOPA Certificate? clearly he didn't follow the brief if he was.
Even if there was no fog on departure, was it forecast? The very fact the student could see it should have given him a clue. What are the weather minima for a QXC?
JAR-FCL 1.125 (b) states: ... at least one cross-country flight of at least 270Km (150nm) during which full stop landings at two different aerodromes to the point of departure shall be made.
He did not meet this requirement so the flight does not count. If the candidate had contacted the school as he should have done to be rebriefed, the FI could have advised him that he would have to make another full stop landing on return or it would not count.
The only time 24 hours comes into it, is if the student is stranded at one of the two airfields due to unserviceability etc, provided the flight is completed within a day (24 hour) it is usually accepted. You don't get a second attempt at going back again if you fail to meet the requiremnents.