In one of my previous commits, I added the lines you see in the diff to avoid the problem with lazy population and the warning.
However I have seen that when I move 2 or more mails with kmail into a different folder, then this method is called with an item
which already has the NEW (target) collection as parentCollection set and then the check seems wrong.
What happens is that this method returns but leaves the items in the old collection and kmail still shows them.
I'm not really sure about how this works here, but at least removing the if-return block again solves the issue and kmail no longer
shows the already moved mails in the old folder.
(I did not analyze why a single mail move did work)