Purge synced documents from iCloud Drive
It works as intended, I’m afraid. “Your Mac keeps all of your recent files on your computer, but keeps your older ones only in iCloud, ready for you to download when you need them again”, Apple says. So as long as you still have enough free space on your hard disk the files will stay there.

Please see Apple’s article Free up storage space on your Mac for tips on how to free up more space on the Mac using iCloud.