Have two screens, two taskbars, each with setting "show windows only in current screen". Disconnect the primary screen (or in my case, close the laptop lid by mistake). Reconnect it. Now the task bar of the secondary screen is empty, but the screen is still full of windows. Moving them around doesn't fix the problem. It took me a while to notice there is no active screen in display settings, and when setting an active screen it works again.
I have a similar problem. When I change the setting in the taskbar of the primary screen to "show windows only in current screen" the windows that were visible before disappear even if they are in the same screen. Moving them from one screen to another and back does not fix the problem. The taskbar stays empty.
Sorry, forgot to mention: Running Fedora 27 with KDE-Plasma 5.12.5 and KDE-Frameworks 5.44.0
I suppose I have a related problem, this happens when connecting my Lenovo Thinkpad to the Thinkpad Docker Pro Station. When I unplugged and plugged a again (the docker is connected to two screens), the task bar gets empty, I have to uncheck "Show only tasks from current screen" and then appear again. Using Plasma 5.14 in Solus.
*** This bug has been marked as a duplicate of bug 414743 ***