I had the same issue, and I fixed it through a pretty simple solution.
Extracting through an External Hard Drive is possible, but I didn't have one. I only had a 16GB pen drive.
My MacBook had only about 30 GB of space. I moved my Xcode file to the 16GB pen drive and I got more space to work. (Which is about 40 GB).
But here, there's another issue. I couldn't extract in the pen drive either.
The Archive Utility has the option to change the path, where it should be extracted. (In the Archive Utility Preferences) So I changed the path to Macbooks Downloads (Can place which ever location) and extracted from the 16GB Pendrive. It didn't show the not enough space warning this time, and worked perfectly.
Later I moved the extracted Xcode file to Applications folder.
Try this method, May worked for you too.
Me also getting same problem whenever I try to update Xcode. At least it should show update size of any app. It doesn't show update size for any app in App Store. How can we know which update is consuming how much data? If it explicitly asks that I want exactly this much of space for installing updates then we can do something about it. Without showing update size it simply goes on asking for more space for whatever free space we provide. Anyway this problem was encountered when I updated from
Catalina 11.15 to Big Sur 11.0 (trouble moving Xcode from 12.4 (12D4e)) to 12.5