If editors are opened without being visible (e.g. by using the "Rename Symbol" command), then the onDidOpenTextDocument event fires for each opened file. However, if those editors are closed before becoming visible (e.g. by clicking the "Close All Editors" button), then the onDidCloseTextDocument event does not fire. Because that event does not fire, the diagnostics for those closing files are not removed from the diagnostics collection, and the diagnostics remain in the Problems panel.
If editors are opened without being visible (e.g. by using the "Rename Symbol" command), then the onDidOpenTextDocument event fires for each opened file. However, if those editors are closed before becoming visible (e.g. by clicking the "Close All Editors" button), then the onDidCloseTextDocument event does not fire. Because that event does not fire, the diagnostics for those closing files are not removed from the diagnostics collection, and the diagnostics remain in the Problems panel.