Reclaiming it is three steps and skipping the first is why people report that compaction "did nothing".
1. Tell the filesystem to release the blocks. Inside the distro:
sudo fstrim -av
This is the step that communicates downward — it discards blocks Linux no longer uses so the virtual disk layer can see they are free. Without it, the compactor looks at the disk, sees data everywhere, and correctly reclaims nothing.
2. Shut everything down, from PowerShell, because the file cannot be in use:
wsl --shutdown
Give it a few seconds. Docker Desktop must be closed too, or it holds its own distro open.
3. Compact the file. diskpart as administrator:
select vdisk file="C:\Users\<you>\AppData\Local\Packages\<distro>\LocalState\ext4.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk
On a 90GB file holding 12GB, expect it to come back close to the real usage.