Schach is muktzeh therefore cannot be fixed by a Jew during chag or Shabbat, but can be fixed during hol hamoed.
See for instance this digest of Sukkot laws
If Schach blows out of place on Yom Tov, one may not fix it, since the
Schach is Muktzeh. However, if the Sukkah is no longer Kosher (or its
status is questionable), one should consult with a Rov ...
The Chasam Sofer in his Torah commentary and Responsa (O.C. 185) explains that the army left the camp in order to wage war and was thus no longer surrounded by the Clouds of Glory. The Sukkah commemorates entering the land of Israel, which commenced with these battles fought by soldiers who needed the shelter of physical booths. See the commentary for a ...
Shulchan Aruch writes 635/1
סוכה אע"פ שלא נעשית לשם מצוה כשרה והוא שתהיה עשויה לצל כגון סוכת עכו"ם
As long as a Sukka was made - meaning if the schach was put up - to make shade, it is kosher, such as a one put up by a non Jew.
It's apparently an oral tradition relating to one of the students of the Vilna Gaon, Rabbi Yisrael of Shklov. The more complete story is recounted here in Hebrew. It begins like this:
הגאון רבי ישראל משקלוב מספר, על תלמיד מתלמידי הגר"א, שבא לקבל פני רבו בחול המועד סוכות, וביקש מרבו כי יעמידו במבחן על כל מסכתא דסוכה על פה. היה זה אחר שקודם החג עורר הגאון ...