Most likely either create a new category and slowly delete the old ones, unless there's an external "old patch" version exists which will allow runs to be played.
If GSG changes cave generation, the same applies. New versions will have their own category, as old categories will be obsolete and deleted after a while.
Minor changes (like bosco upgrades from patch 20) will probably not affect the leaderboards unless the change impacts the speedruns so negatively that the WR cannot ever be beaten again.
It depends if the change is a nerf, buff, or overhaul, and whether the change is universal or localized.
As long as the patch is a buff (like bosco's damage/mining) or a localized change (flamer nerf) then things should be okay.
Obviously "localized" is subjective and even though something like Sandblasted is just one biome in the game, if all the WR from Sandblasted couldn't be beaten in any other biome, and Sandblasted gets nerfed, then that's pretty universal
It's not something you can template, it will need to be considered on a case by case basis