Apache on localhost doesn't recognize a website unless I include the full path to index.html
As it appears you do not have any idea about what you broke earlier, you might run into other interesting problems later even if you figure out how to fix this.
I would strongly suggest you reinstall Apache to get back to its original configuration.  As this appears to be a part of the Big Sur installation (and not XCode) you probably need to boot to recovery mode and reinstall Big Sur from there to get the system back in a known state.
You may also be able to just restore the Apache folder from your time machine backup.
In the future I suggest you develop against something more controllable.  These days a good suggestion is using Docker with a suitable Apache container.  You are also strongly suggested to learn and use version control of your code, so you don't lose anything if you suffer from hardware failure.