AS a workaround you might try dragging this panel so it "docks" in just below the Histogram. You will probably find the Masks panel opens and shuts more reliably when 'fixed' in this way, than it does when 'floating'.
Personally, I prefer this docked position anyway.
I guess that at some point the LrC interface may get fully redesigned such that all the panels are properly movable, or else that may never happen. But this fly-out Masks panel does seem to be a little problematic for the meanwhile.