Xcode giving not enough space issue with 40 GB space available , any suggestions ?

Hi,
I have early 2015 Macbook Pro laptop.
I installed Big Sur 11.2 today. Even before that Mac OS was not allowing me to install Xcode.
Now which version should I downgrade to so it works I can start coding again in Xcode.

Or any alternate way to start and enable myself to use Xcode 12 somehow please help

Error : we could not complete purchase. Not enough space on disk
.

Disk has 40 GB space empty
Xcode needs 12 GB
Xcode giving not enough space issue with 40 GB space available , any suggestions ?
 
 
Q