I can understand how that happens, but I wouldn't expect this to be desired behavior. And even though the 7z file might remove the directory record, if you then extract the 7z file, the folder is there in the results, because of course it has to be in order to have those files inside. Compare this to Windows File Explorer search - the results there are similarly flat, but deleting a folder actually deletes it, including its contents. If deleting a folder doesn't actually remove its contents from...
I'm seeing this in 7-zip 26.04 (x64) on Windows 11
Unable to delete from 7z files in flat view