Yesterday I also had faced the same issue where entire half-day i was trying multiple ways to solve the issue by cleaning the vscode server file from the wsl and then reinstalling it and then taking the backup of the wsl env for the backup so that it can be used to reinstall with those same earlier setup.
But then came to that the issue seems to with the distribution (where in my case it was CanonicalGroupLimited... for Ubuntu) being corrupted or some issue with the wsl environment.
SO I had to reinstall the whole wsl setup by taking the distro's backup first and then referring to its history and then reinstalling each and every setup or config accordingly