Emptying the trash doesn't move emails out of a smart folder
Your understanding is very correct and one of two things is the root of your confusion and the software not working dependably.


Spotlight is the database where all files get indexed. That indexing then shows which files are mail messages and which are responsive to an ad-hoc search within the mail app or a programmed search which is called a “smart mailbox”
Spotlight can’t work if the disk underneath has errors in the filesystem.


To triage or troubleshoot this, I would log out and then power off the Mac. If you have fast internet and a modern Mac, boot to internet recovery and run Disk Utility to repair the boot drive. This is best since you don’t want to trust your copy of Disk Utility to do a live check since you can’t fix all the things if you have corruption.


https://support.apple.com/en-us/HT201716


Next, consider rebuilding the spotlight database for your user account by placing your home folder into spotlight preferences as a private location not to be indexed.

Then do a second restart to let spotlight see your files freshly when you remove the privacy setting. If you have an SSD and less than 100 GB of data in your home folder, the search will need an hour or three to rebuild. Don’t worry if smart folders are not correct while spotlight shows a reindex in process.

Only after you’re sure things are good on the foundation, perhaps look at rebuilding the mailbox envelopes or vacuuming the index.


Mail search not finding messages but Spotlight does


Lastly, I should have put a first warning in - are your backups complete for this mac? Consider getting a good backup before you try to fix anything if you can’t afford to lose any files you have now on this mac.