Windows 10 smart cleaning

windows 10 smart cleaning not cleaning upon closing.

Upon closing what?

If you mean browsers then check to see if the browser or it’s extensions is still running in the background. If it’s still running then it isn’t closed.
A browser can’t be cleaned if it’s still running, so you need to turn that background running off.

For example in Edge you go to Settings>System and Performance where you make sure that these two are turned off: