How many files did you move to the external drive and delete in total? Maybe the files that you've cleared up are totally KBs only. So you still can't install Sonoma on your iMac.
You can use a Mac cleaner like iBoysoft DiskGeeker to help you clean useless files on your Mac startup disk to free up more space for the Sonoma installer.
This Mac cleaning tool can help you delete system caches, user log files, useless downloads, and other junk files from your Mac quickly.
- Download, install, and open iBoysoft DiskGeeker.
- Select the Macintosh HD volume and then click Clean Junk from the right toolbar.
- Select the files you want to delete and then click Clean.
If you are sure that you've released a few GBs of space, try to restart your iMac to refresh the space calculation.
Also, the purgeable space can lead to the "not enough space to install macOS Sonoma" issue. The purgeable space refers to the space that is taken up by Time Machine snapshots, app caches, system caches, and other temporary files and can easily be released when needed. The purgeable space is clarified as the used space in Disk Utility.
Besides, in Disk Utility, Macintosh snapshots refer to the local APFS snapshots. Don't equal it to Macintosh in About This Mac.