I just experienced this on my 13" 2020 Macbook Pro M1. When looking at launchpad it showed Xcode installing at 12.58gb of 12.58gb. However in the applications folder I could see 2 xcode icons. One was normal and the other still had the progress bar on it. I was able to launch the normal icon, and as soon as I did the console finally showed something other than the 999 of 1000 message, and then quickly went to 1000 of 1000 and showed install complete.
Maybe I waited enough hours for it to finish at the exact same time, or maybe that second xcode icon had something to do with it....