Were you able to figure this out? I want to achieve similar functionality. I'm looking to hide a panel/section/group if a module within the panel/section/group value is set to true (boolean). I thought something like the following would work, but it doesn't.
You'll want to use an Expression test to evaluate whether or not your widget container is empty. The link I provided has a great example of how to perform an if/then test in HubL. However, I lack the experience to provide the exact code on how to do this for your specific need. Hopefully that documentation is helpful!