This also happens with my dockable pane which I use as an AutoCAD style console output window (much better than annoying the user with a message box whenever you want to tell them something 🙂 ), I implement mine in a different way to the tutorial, so I don't think it has anything to do with the way you have created it. It just seems to be a side effect of the dockable panel system. Does anyone know why this happens?
The behaviour is quite odd, I also have a similar system to what you propose for displaying custom information for the selected elements, except that I have it in a regular modeless winforms dialog. My system makes use of the Idling events to keep up to date with the current selection. I can click over to it and back into Revit without problem and the selection is not affected. When I click inside my dockable pane though, the selection disapears just as you say, including from my winforms dialog. The odd thing is that if I then click back into the graphical view that was previously displaying my selection, the selection re-appears and is highlighted as normal and also appears back in my dialog as if nothing happened.
If I was to implement my selection properties system in a dockable pane, I would again use Revit's idling event to monitor the selection, but I'd also listen for the OnMouseEnter event within the dockable pane. When OnMouseEnter is triggered I'd freeze the selection data I had cached and ignore any selection data provided by the Idling event untill I had again clicked back into Revit. This event should be triggered before the user actually clicks in the pane, so it should have no troubles catching the selection before it is cleared.
The trick would be when to re-enable the selection updating, you don't want to do it untill the user clicks back into Revit, else it could be cleared prematurely.