With subtasks set to 'flattened', clicking on a subtask's icon causes the parent task to be displayed above the subtask. This is helpful given that subtasks do not show any relationship to their parent (which is a feature request I've made in another thread).
With the subtask now indented under its parent you no longer see the subtask's icon, so if you click on the parent task's icon expecting it to be hidden again, it isn't - instead, the subtask gets hidden leaving the parent displayed in the list - where it shouldn't really be displayed.
I think it would be better if clicking on the parent task in this situation caused the parent to be hidden again and the subtask to remain visible (i.e. returning the list to its previous state).
The workaround is to click the current tab to force the entire list to be reloaded, but that's not very intuitive.