Your comments

We are unable to put a test down for this as we cannot map the taskbar items to close it. But the code was found to cause a duplicate close call which was removed.

Issue occurred when trying to close the unpinned window from the taskbar. There is a background call that occurs that tries to close the window twice. This is valid when you right-click the unpinned window and select hide, as this causes a deactivate to occur before the close window gets called. This has been resolved and logging has been added to catch this exception and show as information that the exception is handled in the background.

Branch name: 2506-CloseUnpinnedPaneToolWindowException