This is Bug 278891 - a program closed after dragging to another desktop
creates empty space on taskbar on kde available at
https://bugs.kde.org/show_bug.cgi?id=278891.
As you can see the bug has been closed as invalid together with its tons
of duplicates as Aaron judged the signal to noise ratio
I think we didn't understood ourselves - i suggested you try replacing default
task manager with smooth tasks and see if the problem persists , and also to
check KDE bugs to find is there a similar/same problem as yours (with the
default task manager)
---
Ubuntu Bug Squad volunteer triager